There are a lot of git branch completion scripts floating around out there. Here's another one.
- It's stupid simple (unlike some other scripts)
- It supports any possible git command that uses a branch (or tag) name
- It works when git is aliased to g and/or you are using git aliases (and you should be)
- It only completes remote branches when using
grb track
(gem install git-remote-branch) - It's available to me when I inevitably work on other computers.
curl https://raw.github.com/gist/1443992/200d077154a79f8b0ab32980ecb2e48b1372b8c7/.git-completion.bash > ~/.git-completion.bash
echo 'source ~/.git-completion.bash' >> ~/.bashrc
source ~/.bashrc
Adds branch completion to all git commands, not just branch-specific commands. This isn't an issue for me, and it probably won't be for you either.