2

Let's say you have this list of branches in a git repository:

* master
|
| * b2
|/
* b1
|
* b
// etc

I know that technically branches are only symbolic references in the DAG that is the commit graph.

If I am on the master branch here, is there a command to obtain a list of branches which are only direct ancestors of master? In the above, that would mean b1 and b, but not b2.

fge
  • 119,121
  • 33
  • 254
  • 329

1 Answers1

2

You can use:

git branch --merged master

to show all branches which are completely merged into master, i.e., where the head of that branch appears in the history of master.

Joe
  • 29,416
  • 12
  • 68
  • 88