Need to see which branch(es) contain a Git commit? Try these commands!
List local branches that contain a commit:
git branch --contains <commit>
List remote branches that contain a commit:
git branch -r --contains <commit>
List all (local & remote) branches that a commit:
git branch -a --contains <commit>
via git – How to list branches that contain a given commit? – Stack Overflow.