
上QQ阅读APP看书,第一时间看更新
Installing Git on CentOS/RHEL servers
To install Git on a CentOS or RHEL server, follow these steps:
- From your shell, install Git using yum (or dnf on older versions of Fedora):
$ sudo yum install git
Or:
$ sudo dnf install git
- Verify the installation was successful by typing the following command:
$ git --version
- Configure the username and email address for all repositories:
$ git config --global user.name "firstname lastname" $ git config --global user.email "email@gmail.com"
- Install the necessary build dependencies using dnf (or yum on older versions of Fedora):
$ sudo dnf install curl-devel expat-devel gettext-devel openssl-devel perl-devel zlib-devel asciidoc xmlto docbook2X
Or using the yum-Epel repo:
$ sudo yum install epel-release $ sudo yum install curl-devel expat-devel gettext-devel openssl-devel perl-devel zlib-devel asciidoc xmlto docbook2X
- Symlink docbook2x to the filename that the Git build expects:
$ sudo ln -s /usr/bin/db2x_docbook2texi /usr/bin/docbook2x-texi
- Clone the Git source (or if you don't yet have a version of Git installed, download and extract it):
$ git clone https://github.com/git/git
- To build the Git source and install it under /usr, run make:
$ make all doc prefix=/usr $ sudo make install install-doc install-html install-man prefix=/usr
Following the preceding steps will install and configure Git on a CentOS/RHEL server.