Installing Git
- Download the source code of Git v2.21.0.
1wget https://github.com/git/git/archive/v2.21.0.tar.gz - Decompress v2.21.0.tar.gz.
1tar -zxvf v2.21.0.tar.gz
- Go to the Git source code directory.
1cd git-2.21.0/
- Check whether Git has been installed. If no, skip this step. If yes, uninstall the original Git.
1git

- Optional: Uninstall the original Git.
1yum remove git
- Compile Git.
1 2 3 4
autoconf ./configure --prefix=/usr/local/git make make install
- Configure Git environment variables.
1echo "export PATH=$PATH:/usr/local/git/bin" >> /etc/profile
- Make the environment variables take effect.
1source /etc/profile
- Query the Git version.
1git --versionIf the following information is displayed, Git has been installed:

Parent topic: Configuring the Environment