Identify merged branches
# View merged
git branch --merged
# View merged remote
git branch -r --merged
# View unmerged
git branch --no-merged
# View unmerged remote
git branch -r --no-mergedThe above cases run the merge check from the point of view of HEAD as this is the default.
But we can also run it from any branch.
git branch --merged non_head_branchDemonstration
We have the following branches
git branch
* main
key_feature
another_featureThe branches other than main, have not been merged:
git branch --merged
* mainJust to confirm:
git branch --no-merged
key_feature
another_feature