Is there any way to get the output of git branch -v
as a plumbing command? To be exact I'm only interested in the state of the branch, i.e. whether it is [gone]
or not.
For example given the following git branch -v
output:
> git branch -v
master 32c59ad4 Some other comment
someDeletedBranch 6aacba47 [gone] Some Comment
How could I get the someDeletedBranch
ref?
Note that this is not the same as git branch --merged
, if for example you're squashing pull requests into your master, so this solution won't do.
This is mostly in relation to this question, since this would be the missing part for being able to create a reliable script to remove local branches that don't exist on the remote any longer.