I recently installed git. I am using Ubuntu 14.04. However the autocomplete feature is not working.
Whenever I type git i
then TAB it should be git init
but it doesn't happen so. I have tried everything mentioned in this page, still no success.
Whenever I do git in
then TAB it seems like git is pinging unknown host. Below is the screenshot:
How do I resolve this?
Use this script for Ubuntu:
https://github.com/git/git/blob/master/contrib/completion/git-completion.bash
Read the documentation on how to set it up:
To use these routines:
1) Copy this file to somewhere (e.g. ~/.git-completion.bash).
2) Add the following line to your .bashrc/.zshrc:
source ~/.git-completion.bash
3) Consider changing your PS1 to also show the current branch,
see git-prompt.sh for details.
A shorter solution:
# install the bash-completion vai apg-get
sudo apt-get install git bash-completion
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With