In command line, how can I check whether a branch has been merged into another branch, and if yes, find out which branch it has been merged into?
git branch --contains <branch>
will print all local branches where the commit labelled by <branch>
is an ancestor.
With
--contains
, shows only the branches that contain the named commit (in other words, the branches whose tip commits are descendants of the named commit)
--contains
[]
Only list branches which contain the specified commit (HEAD if not specified)
git branch --contains <commit/tag/branch>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With