赞
踩
[git@centos100 ~]$ sudo yum install gcc
[git@centos100 git-2.9.5]$ sudo yum install zlib-devel
下载 perl
[git@centos100 git-2.9.5]$ curl -O https://www.cpan.org/src/5.0/perl-5.28.0.tar.gz
解压 perl
[git@centos100 ~]$ tar zxf perl-5.28.0.tar.gz
安装 perl
[git@centos100 perl-5.28.0]$ ./Configure -des -Dprefix=/usr/local/perl-5.28.0
[git@centos100 perl-5.28.0]$ make
[git@centos100 perl-5.28.0]$ sudo make install
perl 查看版本号
[git@centos100 ~]$ perl -v
This is perl 5, version 28, subversion 0 (v5.28.0) built for x86_64-linux
Copyright 1987-2018, Larry Wall
[git@centos100 ~]$ curl -O https://mirrors.edge.kernel.org/pub/software/scm/git/git-2.9.5.tar.gz
[git@centos100 git-2.9.5]$ tar zxf git-2.9.5.tar.gz
[git@centos100 git-2.9.5]$ cd git-2.9.5
[git@centos100 git-2.9.5]$ ./configure --prefix=/usr/local/git-2.9.5
[git@centos100 git-2.9.5]$ make
[git@centos100 git-2.9.5]$ sudo make install
添加到环境变量:
[git@centos100 git-2.9.5]$ sudo vi /etc/profile
export GIT_HOME=/usr/local/git-2.9.5
export PATH=$PATH:$GIT_HOME/bin
使环境变量生效
[git@centos100 git-2.9.5]$ source /etc/profile
添加软连接
[git@centos100 bin]$ sudo ln -s /usr/local/git-2.9.5/bin/git-upload-pack /usr/bin/git-upload-pack
[git@centos100 bin]$ sudo ln -s /usr/local/git-2.9.5/bin/git-receive-pack /usr/bin/git-receive-pack
[git@centos100 ~]$ mkdir repository/my_project
[git@centos100 my_project]$ git init --bare my_project.git
$ git clone git@192.168.158.100:/home/git/repository/my_project/my_project.git
Cloning into 'my_project'...
git@192.168.158.100's password:
warning: You appear to have cloned an empty repository.
安装完毕。。
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。