Git autocompletion

git auto completion

Remembering the branches and all the available commands are daunting work in git. what if the commands auto-completes itself like shown in the above gif. we can save a lot of typing. not all of us have a typing speed of 90+ wpm right?.

For this, we need to configure our terminal with git auto-completion snippet. you can download the bash-completion file from here. Download the file from these links if you're using bash, or zsh or shell.

You can download with simple curl command also like this,

curl https://raw.githubusercontent.com/git/git/master/contrib/completion/git-completion.bash -o ~/.git-completion.bash

and add the downloaded file in ~/.bashrc or ~/.zshrc depends on your terminal like this.

# bash
if [ -f ~/.git-completion.bash ]; then
  . ~/.git-completion.bash
fi
#zsh
source ~/.git-completion.bash

restart the terminal and enjoy the git auto-completion.

« (You tried hard and you gave your best! still you failed and it's ok!)(Evaluating documentation frameworks for personal projects.) »