You’re closer than you think to a career in tech. Our grads have launched rewarding new careers — you can too.View Our Jobs Report
As a babe in this programming excursion, I am always looking for help while I tool around. This has been very true with my playtime with ‘Git’. On Friday I wanted to find out if there is a tab-completion ability in Git. This led me down a trail that revealed a precious jewel, for me at least.
Having tab completion allows quick command searching and tab completion of branch names. See the following screenshot for a command search.
Auto completion/tab completion
go to the Github Git Source Page
within the git directory you want to find the contrib directory
within contrib directory you want to find the completion directory
I am using bash so I need the bash file, but for Zsh, use the Zsh file.
click on the file that corresponds to it git-completion.bash
next click on the raw button to remove formatting and then select all of the text
create a file in your home directory called .git-completion.bash and paste in the text
inside of your .bash_profile file, add the line ‘source ~/.git-completion.bash’
Once these steps are completed you can get into a git directory and type in ‘git’. Make sure you have a space after git and you can either press tab, or begin the next word and tab from there. You can auto complete words you are typing and also use it as a look-up tool.
There seems to a bug for me where I have to tab twice to get it working, but it could be like me where a little prodding goes a long way.
Use with care and if there is a better way let me know.
Blog Post Author
Since we opened our doors in 2012, thousands of students have joined Flatiron School to launch new careers in tech.
Find the perfect course for you across our in-person and online programs designed to power your career change.
Connect with students and staff at meetups, lectures, and demos – on campus and online.
Have a question about our programs? Our admissions team is here to help.