Sometimes we need to debug the project, and there may be some problems when using the Git environment built in the local Windows environment, so I directly set up the Git tool environment in the VPS environment. Although the git source is included in the Linux system environment, we can directly install yum or apt-get. However, if the source is not the latest version, an error occurs when the installed git environment submits the version, therefore, you must manually install git to ensure that the tool is used properly.
Yesterday in the Q group, I saw some netizens mentioned the problem of Installing git in the Centos environment. So I collected information this morning, share The git installation method based on the centos 6 64-bit environment.
1. Install the compiling environment
The code is as follows: |
Copy code |
Yum-y install zlib-devel openssl-devel perl cpio expat-devel gettext-devel curl
|
Run the above script to install some basic environment dependency packages necessary for the git environment.
2. Download and install the git version
Log on to SSH on the current VPS host and run the following command.
The code is as follows: |
Copy code |
Http://soft.laozuo.org/git/git-2.4.5.tar.gz
Tar-zxvf git-2.4.5.tar.gz
Cd git-2.4.5
Autoconf
./Configure
Make
Make install
|
Through the above steps, we download the current newer version of the git-2.4.5, and then compile the installation.
Finally, we can use the git -- version command to view the current GIT version. In this way, you can install it in the GIT tool environment with a higher version. By default, version 1.7 of the environment package is too low to submit the version.