Difference between revisions of "Install Git Specific Version in Linux CentOS"

From Gejoreuy
Jump to navigation Jump to search
(Created page with "== Step by Step == Prerequisites. [root@gejoreuy ~]# yum install curl-devel expat-devel gettext-devel openssl-devel zlib-devel [root@gejoreuy ~]# yum install gcc perl-ExtU...")
 
 
(2 intermediate revisions by the same user not shown)
Line 6: Line 6:
 
  [root@gejoreuy ~]# yum install gcc perl-ExtUtils-MakeMaker
 
  [root@gejoreuy ~]# yum install gcc perl-ExtUtils-MakeMaker
  
Install Git (Change 2.25.0 version with our needs).
+
Install Git (as example, we install git version 2.25.0; we can change the version with our needs).
  
 
  [root@gejoreuy ~]# cd /root/Downloads
 
  [root@gejoreuy ~]# cd /root/Downloads

Latest revision as of 10:02, 12 September 2020

Step by Step

Prerequisites.

[root@gejoreuy ~]# yum install curl-devel expat-devel gettext-devel openssl-devel zlib-devel
[root@gejoreuy ~]# yum install gcc perl-ExtUtils-MakeMaker

Install Git (as example, we install git version 2.25.0; we can change the version with our needs).

[root@gejoreuy ~]# cd /root/Downloads
[root@gejoreuy Downloads]# wget https://mirrors.edge.kernel.org/pub/software/scm/git/git-2.25.0.tar.gz
[root@gejoreuy Downloads]# tar xzf git-2.25.0.tar.gz

Compile the source code.

[root@gejoreuy Downloads]# cd git-2.25.0
[root@gejoreuy git-2.25.0]# make prefix=/usr/local/git all
[root@gejoreuy git-2.25.0]# make prefix=/usr/local/git install

Setup environment.

[root@gejoreuy git-2.25.0]# echo 'export PATH=/usr/local/git/bin:$PATH' >> /etc/bashrc
[root@gejoreuy git-2.25.0]# source /etc/bashrc

Check if the installation successfully with checking the git version.

[root@gejoreuy git-2.25.0]# git --version