2010-08-18 Git中判断一个commit是否在某个branch中
方法1:
git branch --contains commit
方法2:查找reflog
git reflog show --all | grep a871742
会有类似如下的结果:
a871742 refs/heads/[email protected]{0}: commit (amend): mpc-completion: total rewrite
,其中 completion 就是所在的 branch注:
git reflog show
等价于git log -g --abbrev-commit --pretty=oneline