git的使用(三)

2017-04-07  本文已影响0人  AndroidCat

分支管理

分支作用

创建与合并分支

实战

$ git checkout -b dev
Switched to a new branch 'dev'
$ git branch dev
$ git checkout dev
Switched to branch 'dev'
$ git branch
* dev
  master
Creating a new branch is quick.
$ git add readme.txt 
$ git commit -m "branch test"
[dev fec145a] branch test
 1 file changed, 1 insertion(+)
$ git checkout master
Switched to branch 'master'
$ git merge dev
Updating d17efd8..fec145a
Fast-forward
 readme.txt |    1 +
 1 file changed, 1 insertion(+)
$ git branch -d dev
Deleted branch dev (was fec145a).
$ git branch
* master

Git鼓励大量使用分支:

上一篇下一篇

猜你喜欢

热点阅读