Before start make sure where is git-completion script is installed. Usually it's located in following paths:
- /etc/bash_completion.d/git
- /usr/share/bash-completion/completions/git
- Open ~/.bashrc file in text editor (I prefer nano):
$ nano ~/.bashrc- Append to file one of these lines (depends on where you've dscovered script):
source /usr/share/bash-completion/completions/git
# or
source /etc/bash_completion.d/git- Reload ~/.bashrc (or terminal):
$ source ~/.bashrc