Browse By

Git auto-completion in Bash

git autocompletion bash

If you are a git user in bash then you will find useful the auto-completion script from git-scm.com. For mac users just run in the following commands:

curl -O https://raw.githubusercontent.com/git/git/master/contrib/completion/git-completion.bash
echo "source ~/git-completion.bash" >> .bash_profile

Restart your terminal and you are good to go!

If you’re using Windows with Git Bash, which is the default when installing Git on Windows with msysGit, auto-completion should be preconfigured.

Press the Tab key when you’re writing a Git command, and it should return a set of suggestions for you to pick from:

$ git co
commit config

For more info check here

Leave a Reply

Your email address will not be published. Required fields are marked *