1

I have an faulty Git branch (let's name it Branch-E) that has been merged to master. While I've already had that resolved, I need to know, is there a way to list all the other branches in which this branch has been merged into?

I know I can do this to all suspected branches one by one:

git checkout Branch-A
git branch --merged Branch-A -r

which shows all branches merged into Branch-A. But I need to know if there's a way to list ALL remote branches affected by the erroneous Branch-E. Kind of like the other way around. Take note that I'm looking for a list of branches that contain another branch, not a particular commit. Thank you.

d4ryl3
  • 272
  • 1
  • 3
  • 9
  • 1
    Possible duplicate of [How to list branches that contain a given commit?](http://stackoverflow.com/questions/1419623/how-to-list-branches-that-contain-a-given-commit) – Andrew C Feb 03 '16 at 01:06
  • Related, but IMO probably not a duplicate: http://stackoverflow.com/q/16304574/1858225 – Kyle Strand Feb 03 '16 at 01:07
  • The solution to these questions don't exactly resolve my problem, as I'm looking for a list of branches that contain another branch, not a specific commit. I found that out shortly after posting this and I've answered my question as well. Thanks. – d4ryl3 Feb 03 '16 at 05:25

1 Answers1

1

Found the answer after using better wording on my Google search:

git branch --contains <branch name> -r
d4ryl3
  • 272
  • 1
  • 3
  • 9