打赏

GIT-多人协作

GIT-多人协作-方式一

1.由一个队友,创建本地分支:

git checkout -b local_branch
e.g.
git checkout -b dev

2.再由该队友推送该本地分支到远程origin仓库:

git push origin local_branch:remote_branch
e.g.
git push origin dev:dev

这个操作,local_branch必须为你本地存在的分支,remote_branch为远程分支,如果remote_branch不存在则会自动创建分支。 (类似,git push origin :remote_branch,local_branch留空的话则是删除远程remote_branch分支。)

3.其他小伙伴将代码git clone到本地

4.然后拉取远程上的分支到本地新创建的分支上:

git checkout -b local_branch origin/remote_branch
e.g.
git checkout -b dev origin/dev

然后小伙伴们就可以在dev上玩耍了

posted @ 2019-05-03 23:07  futureme  阅读(142)  评论(0编辑  收藏  举报