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?
grephas a-Foption which matches fixed strings. Would be useful for what you’re doing.Unfortunately,
-Fwill filter out branches names that have a partial match. As suggested by antak, we can usecomminstead for a more reliable diff.