Git Installation on CentOS |
1. Git Installation in RHEL/CentOS/Oracle Linux
Install Git from Source Select the latest stable version from the Download location: https://mirrors.edge.kernel.org/pub/software/scm/git/Before you begin, first you need to install required software dependencies from the default repositories, along with the utilities that needed to build a binary from source:
yum groupinstall -y 'Development Tools'; yum install -y autoconf curl-devel expat-devel gettext-devel openssl-devel \ perl-CPAN zlib-devel gcc make perl-ExtUtils-MakeMaker cpio perl-CPAN vim
Next: After you have installed required software dependencies, go to the official Git release page and grab the latest version and compile it from source using following series of command: Note here on the cloud such as AWS free-tier RHEL 8 instance we don't have 'wget' command installed so lets install it. This is like the commandline browser and download tool.
yum install -y wget
2. Download & Extract the git source code
We can use the Unix download manager - wget command for download the git source code to pull as:wget https://www.kernel.org/pub/software/scm/git/git-2.23.0.tar.gz
Extract the downloaded file:
tar zxf git-2.23.0.tar.gz
3. Compile and make install
Now the installation of the Git on your Linux: configure the git source code from the foldercd git-2.23.0 ./configure make # Compile the source code make install prefix=/usr install
4. Verify the git installation
Once all the above steps are executed, run the git version command to verify whether the Git application is successfully installed or not.git --version
Hope you enjoyed this post, You may also wish to visit the 'Uninstall Git from CentOS/RHEL/OL'.Next learning - Git Configurations
Try trick on your Git bash or git client see the change! Hope you enjoyed this learning don't keep it with you share it to your friends!