Last Updated: February 25, 2016
·
382
· danbt79

Making 'git branch --contains' less tedious

Find yourself repeatedly using:
bash git branch --contains [commit-hash]
in order to track changesets?

Here's a handy function you can include in your .bash_profile to save your keystrokes:

function gbc() { git branch --contains $1; }

Now you can simply call
bash gbc [commit-hash]
and get your results.

Sometimes it's the simple things in life that matter!