in 系统(System)

Git中判断一个commit是否在某个branch中

方法1:

git branch --contains commit

方法2:查找reflog

git reflog show --all | grep a871742

会有类似如下的结果:

a871742 refs/heads/completion@{0}: commit (amend): mpc-completion: total rewrite

completion就是所在的branch 注:

git reflog show

等价于

git log -g --abbrev-commit --pretty=oneline

发表评论

  • Related Content by Tag