Linux basic software installation Git (server installation)

Posted by tallberg on Thu, 13 Feb 2020 20:15:01 +0100

brief introduction

Git is an open source distributed version control system for agile and efficient processing of any small or large project. Git is an open source version control software developed by Linus Torvalds to help manage Linux kernel development.

In the current software development, Git/SVN, two version control systems, are the basic skills of developers. Here I simply record the process of installing Git on my own server for your reference.

See more(


Basic environment preparation

Now, we can download the GIT installation package of the version of centos7 / Linux on git official website( Git official website ), and place the installation package in the directory you want to install

# wget download package
[thinktik@thinkcent install]$ wget 20:13:13--

Resolving (, 2604:1380:2001:3900::1
Connecting to (||:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 7498807 (7.2M) [application/x-gzip]
Saving to: 'git-2.18.0.tar.gz'

100%[===============================================================>] 7,498,807   58.8KB/s   in 1m 40s 

2018-07-16 20:14:58 (73.0 KB/s) - 'git-2.18.0.tar.gz' saved [7498807/7498807]

# See git download completed in the installation directory
[thinktik@thinkcent install]$ ls
git-2.18.0.tar.gz  nexus-3.10.0-04-unix.tar.gz  nodejs8  Python-3.6.6.tgz    zookeeper-3.4.10.tar.gz
java8              nginx-1.12.2.tar.gz          python3  redis-4.0.9.tar.gz

Install dependent environment package

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

Decompress and compile

# decompression
[root@thinkcent install]# tar -zxvf git-2.18.0.tar.gz 
# Enter the unzip directory
[root@thinkcent install]# tar -zxvf git-2.18.0.tar.gz 
# Create installation directory
[thinktik@thinkcent install]$ mkdir git
# Configure compilation path
[thinktik@thinkcent git-2.18.0]$ ./configure --prefix=/home/thinktik/install/git
# Compile
[thinktik@thinkcent git-2.18.0]$ make
# install
[thinktik@thinkcent git-2.18.0]$ make install

# Program files appear in the installation path after installation
[thinktik@thinkcent install]$ cd git
[thinktik@thinkcent git]$ ls
bin  libexec  share

Configure environment variables

# Modify user environment variables
[thinktik@thinkcent git]$ vim ~/.bash_profile 
# Apply user environment variables
[thinktik@thinkcent git]$ source ~/.bash_profile 
# Verification Verify successfully see git Installation version
[thinktik@thinkcent git]$ git -version
Unknown option: -version
usage: git [--version] [--help] [-c name=value]
           [--exec-path[=<path>]] [--html-path] [--man-path] [--info-path]
           [-p|--paginate|--no-pager] [--no-replace-objects] [--bare]
           [--git-dir=<path>] [--work-tree=<path>] [--namespace=<name>]
           <command> [<args>]

Topics: git Linux svn nexus