$ git branch iss53 * master testing
master
分支前的 *
字符:它代表现在 checkout 的那一个分支(也就是说,当前 HEAD
指针所指向的分支)master
分支将会随着新的工作向前移动
$ git branch -v iss53 93b412c fix javascript issue * master 7a98805 Merge branch ‘iss53‘ testing 782fd34 add scott to the author list in the readmes
--merged
查看已合并的分支$ git branch --merged
iss53
* master
iss53
分支,所以现在看到它在列表中*
号的分支通常可以使用 git branch -d
删除掉,因为已经将它们的工作整合到了另一个分支,所以并不会失去任何东西
$ git branch --no-merged
testing
它包含了还未合并的工作,尝试使用 git branch -d
命令删除它时会失败:
$ git branch -d testing error: The branch ‘testing‘ is not fully merged. If you are sure you want to delete it, run ‘git branch -D testing‘.
如果真的想要删除分支并丢掉那些工作,可以使用 -D
选项强制删除它
--merged
和 --no-merged
在没有指定提交或分支名作为参数时,分别列出已合并或未合并到 当前 分支的分支。如:尚未合并到 master
分支的有哪些?
$ git checkout testing $ git branch --no-merged master topicA featureB
原文:https://www.cnblogs.com/poloyy/p/14799489.html