Ubuntu - How to Install Git on Ubuntu & CentOS

Install Git on Ubuntu

Installing Git with Apt

#updating the package index:
sudo apt update


# install Git:
sudo apt install git


# Verify the installation
git --version

Install Git on CentOS

# install Git:
sudo yum install git

# Verify the installation
git --version

Configuring Git

The following commands will set your git commit username and email address:

git config --global user.name "Satya Codes"
git config --global user.email "ubuntu_slave@satyacodes.com"

#The configuration settings are stored in the ~/.gitconfig file: