Install Git on Linux

Install Git on Linux

Git is an open source distributed version control system that can efficiently and quickly handle version management of small to very large projects. Foreign GitHub and domestic Coding are both hosting platforms for projects. But when using the Git tool, the first step is to learn how to install git. This tutorial will teach you how to manually compile and install git.

1 Introduction

  Using Coding to manage projects, the git version required above is 1.8.0 or above, and the git version installed automatically on many yum sources is 1.7, so you need to master the manual compilation and installation of git methods.

2. Install git dependencies

  yum install curl-devel expat-devel gettext-devel openssl-devel zlib-devel gcc perl-ExtUtils-MakeMaker

3. Delete the existing git

  yum remove git

4. Download the git source code

  Switch to the directory where your package files are stored

    cd /usr/src

  Download the git installation package

    wget https://www.kernel.org/pub/software/scm/git/git-2.8.3.tar.gz

  Unzip the git installation package

    tar -zxvf git-2.8.3.tar.gz

    cd git-2.8.3

  Configure the git installation path

    ./configure prefix=/usr/local/git/

  compile and install

    make && make install

  View git version number

  git --version

  git is installed

5. Add git commands to bash

  vi /etc/profile

  add in the last line

  export PATH=$PATH:/usr/local/git/bin

  Make the configuration file take effect immediately

  source /etc/profile

 

 

 

 

  1. [zhujiang@localhost git-2.5.2]$ make  
  2.     SUBDIR perl  
  3. /usr/bin/perl Makefile.PL PREFIX='/usr'INSTALL_BASE=''--localedir='/usr/share/locale'    
  4. Can't locate ExtUtils/MakeMaker.pm in @INC (@INC contains: /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5 .) at Makefile.PL line 3.  
  5. BEGIN failed--compilation aborted at Makefile.PL line 3.  
  6. make[1]: *** [perl.mak] Error 2  
  7. make: *** [perl/perl.mak] Error 2  

Check the corresponding error place, vi perl/Makefile.PL

  1. use ExtUtils :: MakeMaker; 
Guessing that the corresponding package is missing, just sudo yum install perl-ExtUtils-MakeMaker

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326112400&siteId=291194637