git笔记

git branch develop  新建分支
git branch 查看分支
    develop
    * master
git checkout develop 切换到develop分支下
git branch 查看分支
    * develop
    master
git push origin develop 把当前分支下的文件拷贝到远程服务器上的develop下
git pull origin develop 把远程分支develop下的文件拷贝到当前分支

git config --global user.name "myname"
git config --global user.email "xxx@.com"
git init
touch README
git add README
git commit -m 'first commit'
git remote add origin git@gitlab.xxx.xxx.com:datamining/xxx.git
git push -u origin master


git add -all  
git branch -a 查看所有分支
git checkout -b develop 新建develop分支


git clone  https://github.com/xxx/xxx.git 将代码down到本地
修改代码
git add xxx
git commit -m '修改代码'
git push origin master 将代码提交到服务器master分支上
刷新git查看

pull有冲突的时候:
git add --all
git commit -m "add  test"
git pull
------------------------

第一次在网站上建立git后:
Git global setup:

git config --global user.name "myname"
git config --global user.email "xxx@xxx.com"

Create Repository

mkdir xiamimusic
cd xiamimusic
git init
touch README
git add README
git commit -m 'first commit'
git remote add origin git@gitlab.xxx.xxx.xxx/xxx.git
git push -u origin master

Existing Git Repo?

cd existing_git_repo
git remote add origin git@gitlab.xxx/xxx.git
git push -u origin master


解决git的pull冲突:参看:http://www.01happy.com/git-resolve-conflicts/
git stash #先将本地修改存储起来
git stash list #可以看到保存的信息
git pull
git stash pop stash@{0} #还原暂存的内容  系统自动合并修改的内容,但是其中有冲突,需要解决其中的冲突
 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值