方法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