Branches that were not merged with master:
git branch -a --no-merged (or git branch -a --no-merged master)
Branches that were merged with
git branch -a --merged feature
Branches that were merged not with
git branch -a --no-merged feature
The git-branch(1) command:
--containsflag shows only the branches that contain the named commit (in other words, the branches whose tip commits are descendants of the named commit).
--mergedshows only branches merged into the named commit (i.e. the branches whose tip commits are reachable from the named commit) will be listed.
--no-mergedshows only branches not merged into the named commit will be listed
- if the argument is missing, it defaults to HEAD (i.e. the tip of the current branch).