How to install git in CentOS 6 or CentOS 7?
Update the packages:
1 2 |
## Update packages sudo yum update -y |
Install Git:
1 2 |
## Install git sudo yum install git -y |
Check if Git installation was successful:
1 2 3 4 |
## Check if git was installed successfully git --version ## should return an output |
Configure and use git:
1 2 3 4 5 6 |
## configure git with your username and email id git config --global user.name " git config --global user.email " ## Create your 1st local git repository git init |
How to install git in CentOS 8?
Update the packages:
1 2 |
## Update packages sudo dnf update -y |
Install Git:
1 2 |
## Install git sudo dnf install git -y |
Check if Git installation was successful:
1 2 3 4 |
## Check if git was installed successfully git --version ## should return an output |
Configure and use git:
1 2 3 4 5 6 |
## configure git with your username and email id git config --global user.name " git config --global user.email " ## Create your 1st local git repository git init |