1

Is there a way to make the shell autocomplete git branch names like it does in linux(mint). While typing, for example,

git push -u origin so<tab>

in linux, this will give me all the branches that start with “so”. Is there a way to get this behavior with the shell (on OS X)?

Chris Page
  • 3,277
  • 1
  • 27
  • 41
  • 1
    This is similar to http://superuser.com/q/53992/81175, except that that’s about autocompleting git subcommands. That was flagged as a duplicate of http://superuser.com/q/288438/81175, which is generically about customizing autocompletion in Bash, which might indirectly help you find a solution, but doesn’t directly answer your question about git branch name autocompletion. – Chris Page Dec 30 '15 at 12:08

1 Answers1

2

The best results possible currently will be found by installing fish: https://fishshell.com

It comes with very snazzy Git completions that work out of the box and targets OS X as a first class platform. I'd suggest installing through homebrew if you have it - otherwise download the pkg installer. You'll probably have it up and running in less time than it'd take to get the disappointing bash completions.

Aaron Gyes
  • 76
  • 6