The --contains option of the git branch command will
list branches which contain the specified commit, in the same format as when
running git branch or git branch --list:
$> git branch --contains aa82193
* some-branch
master
This output indicates that both the some-branch branch and the master branch
contain commit aa82193 (and that some-branch is the current branch).
There is an inverse option, the
--no-containsoption, which will only list branches that don’t contain the specified commit.