How to determine a branch whether has a specified commit
- From
- wuzhouhui <wuzhouhui14@mails.ucas.ac.cn>
- Date
- Dec 19, 2019, 02:35 UTC
- Message-ID
- <62a8f522.6873.16f1c0243f6.Coremail.wuzhouhui14@mails.ucas.ac.cn>
Hi,
I know
git branch --contains <commit>
can display all local branches that has specified commit. However, specify a
branch and commit, I don't know how to determine whether this branch contains
this commit.I think
git branch --contains <commit> | grep <branch name>
is not good enough. Does anyone have a better solution?Thanks.