You want to get git autocomplete in your terminal ? Here is what you can do
Tested Configuration:
MacOS: Sierra 10.12
Terminal: iTerm2 & Terminal
1. Open your terminal
Type sudo nano ~/.bash_profile
Write at the end of the file
source ~/.git-completion.bash
And save. (by hiting Ctrl + X
then hit Y
to confirm)
This part will automatically load the βgit autocompletion scriptβ when your terminal starts.
2. Copy the script
Copy the content of this file (open the page and hit Ctrl + A
, then Ctrl + C
)
Type: sudo nano ~/.git-completion.bash
Paste the content of the file inside ( Ctrl + V
for instance)
Save like before
3. Restart your terminal
To quit Press Cmd + Q
for instance (you must quit, not simply close)
And open your terminal again !
Now you can write git stat
and press tab
-> it will autocomplete into git status