git 多人协作

1.查看远程仓库;

  $git remote

  $git remote -v 更详细的信息;

  $ git remote -v

  $ git remote -v
  origin  git@github.com:zccxy/Repository.git (fetch) 抓取
  origin  git@github.com:zccxy/Repository.git (push) 推送

2.推送分支;

  git push origin master    origin远程库; master本地分支;

  如果推送失败先用 git pull 抓取远程提交;

  从远程抓取分支,使用git pull,如果有冲突,要先处理冲突

3.在本地创建和远程分支对应的分支,

  $git checkout -b branch-name origin/branch-name,本地和远程分支的名称最好一致;
4.建立本地分支和远程分支的关联

  $git branch --set-upstream branch-name origin/branch-name

[Power By XIAOWU]
原文地址:https://www.cnblogs.com/webmans/p/8099687.html