Installation Git with Default Packages is best if you want to get up and running quickly with Git, to install git on Ubuntu 16.04, Ubuntu 15.04, Ubuntu 14.04, Linux Mint, Debian run these following commands:

Install GIT on Ubuntu 20.04, Ubuntu 16.10, Ubuntu 16.04 and Debian

sudo apt-add-repository ppa:git-core/ppa
sudo apt-get update && sudo apt-get install git

Install GIT 2.11.0 on CentOS, RHEL, Fedora

  • First of all, install required dependencies
sudo yum groupinstall "Development Tools"
sudo yum install gettext-devel openssl-devel perl-CPAN perl-devel zlib-devel
  • Download the package from github
wget https://github.com/git/git/archive/v2.11.0.tar.gz
  • Untar the downloaded package
tar -zxf git.ta.gz
  • Change directory to the git folder
cd git-*
  • Run the configuration and set a destination path where to install package by declaring the prefix
make configure
./configure --prefix=/usr/local
  • Finally, to complete the install, run the folowing command and check installed version
sudo make install
git --version

Conclusion

You should now have Git installed and ready to use on your system.

Comments to: How To Install Git on Ubuntu/Centos

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