1. 新建并切换到该分支
$ git checkout -b iss53
Switched to a new branch 'iss53'
相当于:
$ git branch iss53
$ git checkout iss53
2. 切换到分支
$ git checkout master
Switched to branch 'master'
3. 合并分支
git merge hotfix
合并hotfix到当前分支
(再运行一次 git status 来确认所有冲突都已解决)
4. 删除分支
$ git branch -d iss53
5. 使用合并工具
git mergetool
6. 查看
$ git log --pretty=format:'%h %s' --graph
* 734713b fixed refs handling, added gc auto, updated tests
*
d921970 Merge commit 'phedders/rdocs'
|
| * 35cfb2b Some rdoc changes
* | 1c002dd added some blame and merge stuff
|/
* 1c36188 ignore *.gem
* 9b29157 add open3_detach to gemspec file list