Git autocomplete in bash on a Mac

  • Mike

    From one-liners to big applications, whether it comes to Ruby, PHP or JavaScript, there is not much Mike has not learnt over past 6 years. Doing mostly backend, he is capable of creating a system that does the most complicated stuff, while retaining its simple usage. Personally, he is an HTML5, CSS3 and JavaScript freak. Mike was involved in multiple open-source projects, including MediaWiki (wiki engine powering Wikipedia).

    Privately, a brony (go ahead and try Konami Code here), an addicted gamer, karaoke singer and a pub crawler who loves cities of Amsterdam, Cologne and Wrocław.

I've been using Linux and bash for great chunk of time for web development, and it always had great features like autocomplete, that I didn't get by default on a Mac.

So, I've decided to take matters into my on hands, and leave a post for all those, who are also bugged by no git autocomplete in bash on a Mac.

Thankfully, git already has its autocomplete script, so it's a matter of just two commands:

But I like to take it one step beyond. To save some keystrokes, I've added some aliases to my ~/.gitconfig:

Now I can tab on git co and everywhere else I was used to on my Linux machine.

blog comments powered by Disqus
Jan Kus
+49 179 1 35 35 39