Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Show branches that do not contain commit

Tags:

git

branch

dvcs

git branch -a --contains <hash> gives me all those branches containing hash. what I want is git branch -a --no-contains <hash>. Unfortunately, there doesn't seem to be a command to accomplish this, so I'm thinking the solution is something like:

git branch -a | grep -v output of(git branch -a --contains) but my bash isn't up to the task.

Show all branches that commit A is on and commit B is not on? would seem to apply, but the approach seems more complicated than necessary.

What is the best/most simple approach to accomplish the above?

like image 665
kayaker243 Avatar asked May 22 '12 17:05

kayaker243


1 Answers

The --no-contains flag was added in Git 2.13.

like image 72
nonsensickle Avatar answered Oct 04 '22 06:10

nonsensickle