Sunday, 26 January 2020

GIT Autocomplete Command on Linux Machine

Similar like Linux bash commands, git can also provide auto completion feature for GIT command completion. Definitely tab completion will be faster and easier to operate.


This approach is available for Linux/Windows/Mac OS, in this article it's focused on Linux OS.i.e Centos,RHEL,OL,Ubuntu

1. First step is download the script on to your Linux machine, so execute following command to download the script from github and it will place the script in user home directory.

#curl https://github.com/git/git/blob/master/contrib/completion/git-completion.bash -o ~/.git-completion.bash 
2. Add this line to your ‘~/.bash_profile’. This will allow the execution  of the git autocomplete script if it present
if [ -f ~/.git-completion.bash ]; then
  . ~/.git-completion.bash
fi
3. Open new terminal window, now 'git' 'sub-commands' 'tab' should report all the possibilities matching the sub command string.

Saturday, 25 January 2020

Installing GIT on Linux Machine

The process of installing GIT on a Linux Machine is simple as like other packages, provided the Linux machine is configured with yum(CENTOS, RHEL, OL latest repositories), apt(UBUNTU) or other package manager, else local copy of the binary package. If already installed make sure the package is up to date.

CENTOS, RHEL, OL
#yum install git or dnf install git
UBUNTU
#apt install git
Verify the installation by typing the following command which will print the Git version:
#git --version
With Git successfully installed, you can now move on to the setting up GIT local repository.