From: https: //www.cnblogs.com/rstyro/articles/10817855.html
Install Git
In linux, generally installed Git single command, as follows:
- Debian/Ubuntu
apt-get install git
-
Or to update
apt update; apt install git
-
Fedora Series
yum install git
dnf install git
-
Gentoo series
emerge --ask --verbose dev-vcs/git
-
Arch Linux series
pacman -S git
-
openSUSE series
zypper install git
-
Mageia series
urpmi git
-
Nix / NixOS series
nix-env -i git
-
FreeBSD series
pkg install git
-
Solaris 9/10/11 (OpenCSW) Series
pkgutil -i git
But sometimes older version installed. Not what we want
The latest version is installed
In Github, https://github.com/git/git/releases download the latest version.
In 2019-5-5, the latest version:v2.21.0
- Download version v2.21.0
wget https://github.com/git/git/archive/v2.21.0.tar.gz
- Installation depends
yum -y install curl-devel expat-devel gettext-devel openssl-devel zlib-devel gcc perl-ExtUtils-MakeMaker
- Decompression
tar -zxvf v2.21.0.tar.gz
- Into the extracted directory
cd git-2.21.0/
- Compile
make prefix=/usr/local/git all
-
Git mounted in the / usr / local / git path
make prefix=/usr/local/git install
-
Configuration environment variable
# 编辑环境配置文件
vim /etc/profile
# 末尾添加
export PATH=/usr/local/git/bin:$PATH # 立马生效 source /etc/profile
git version git version View installed by check, the installation was successful.
git Uninstall
yum remove git
Install Git
In linux, generally installed Git single command, as follows:
- Debian/Ubuntu
apt-get install git
-
Or to update
apt update; apt install git
-
Fedora Series
yum install git
dnf install git
-
Gentoo series
emerge --ask --verbose dev-vcs/git
-
Arch Linux series
pacman -S git
-
openSUSE series
zypper install git
-
Mageia series
urpmi git
-
Nix / NixOS series
nix-env -i git
-
FreeBSD series
pkg install git
-
Solaris 9/10/11 (OpenCSW) Series
pkgutil -i git
But sometimes older version installed. Not what we want
The latest version is installed
In Github, https://github.com/git/git/releases download the latest version.
In 2019-5-5, the latest version:v2.21.0
- Download version v2.21.0
wget https://github.com/git/git/archive/v2.21.0.tar.gz
- Installation depends
yum -y install curl-devel expat-devel gettext-devel openssl-devel zlib-devel gcc perl-ExtUtils-MakeMaker
- Decompression
tar -zxvf v2.21.0.tar.gz
- Into the extracted directory
cd git-2.21.0/
- Compile
make prefix=/usr/local/git all
-
Git mounted in the / usr / local / git path
make prefix=/usr/local/git install
-
Configuration environment variable
# 编辑环境配置文件
vim /etc/profile
# 末尾添加
export PATH=/usr/local/git/bin:$PATH # 立马生效 source /etc/profile
git version git version View installed by check, the installation was successful.
git Uninstall
yum remove git