We have about a dozen branches in a “folder” affectionately called zoo (has convenience of sorting to the end and isn’t an entirely inaccurate descriptor). Essentially it’s work that we might return to in a few months but don’t want clogging up our branch listing.
In the visual Git client Tower, there’s a nifty feature whereby the branches named zoo/branch-a and zoo/branch-b are represented as collapsed under the folder zoo. I know that Git doesn’t actually think of branch-a and branch-b as existing within a folder, but I wanted to know if there’s a way to configure the command-line git client to behave in a similar way.
The simplest solution is to hide these branches by aliasing something like gba to git branch -a | grep -v "zoo", but this loses the color coding of branch types (remote/local/current) that I get with git branch -a. Is there a way to pass through these preferences from .gitconfig or to preserve the color coding provided by git branch -a when piping the output through grep?
git branch --color=always -a | grep --color=never -v "zoo"should preserve the color coding provided bygitwhen piping the output throughgrep.