Centos git build method tutorial, centos build git
1. Install the dependent Library
Yum install curl-devel expat-devel gettext-devel openssl-devel zlib-devel
2. Install the compilation tool
Yum install gcc perl-ExtUtils-MakeMaker
3. Download git to/usr/local/src
Cd/usr/local/src
Wget
4. decompress and compile
Tar-zvxf git-2.10.0.tar.gz
Cd git-2.10.0
Make all prefix =/usr/local/git
Make install prefix =/usr/local/git
5. Configure Environment Variables
Echo 'export PATH = $ PATH:/usr/local/git/bin'>/etc/bashrc
Source/etc/bashrc
Git -- version
6. Create a git account and password
Useradd-m bin
Passwd bin
6. Create a git repository and initialize it.
Mkdir-p/data/repositories
Chmod 755/data/repositories
7. Modify the last line of/etc/passwd and change the bin logon shell to git-shell.
Bin: x: 500: 500:/home/bin:/usr/local/git/bin/git-shell
8. Test
Cd ~ & Git clone bin@123.207.27.137:/data/repositories/test. git