How can I list branches with no descendants in git? I want a way to list all distinct development paths, for example, to determine which branches require merging.
Asked
Active
Viewed 165 times
0
-
1"Descendants" isn't how git thinks - a commit knows its parents, not its children. What you're really asking is to list all branches for which there are no branches with them as ancestors. – Cascabel Jan 27 '11 at 19:44
1 Answers
2
Running
$ git branch --no-merged
will show you the names of all branches that haven't been merged into your current branch. Likewise,
$ git branch --merged
will show you all the branches that have been merged into your current branch.

mipadi
- 398,885
- 90
- 523
- 479
-
Not really what I want. Consider branches master, foo and bar where bar is a descendant of foo. I only want bar list (and possibly master if it has any changes not in bar). Your solution would list foo and bar. – user492922 Jan 27 '11 at 18:30