git使用分支也可进行多人协作开发。

一、创建分支

git branch zhaozilong 创建一个 zhaozilong 的分支

二、查看所有的分支

git branch -a :查看当前的所有分支(带星的表示当前分支)

三、切换到分支

git checkout zhaozilong:将分支切换到 zhaozilong 分支,同样可以切换到 master 主分支

四、git rebase master

在zhaozilong分支下执行 git rebase master 会将 zhaozilong 分支的起始点 ,移到 master 分支最后的 commit 上。

五、合并提交

切换到 master 分支(git checkout master),执行合并 git merge zhaozilong , 然后就可以提交推送了。

git---分支的合并

 

相关文章:

  • 2021-07-19
  • 2021-09-17
猜你喜欢
  • 2022-01-12
  • 2021-11-26
  • 2021-10-29
  • 2022-01-13
  • 2021-05-05
  • 2021-12-31
相关资源
相似解决方案