#删掉旧版本的git
yum info git
yum install curl-devel expat-devel gettext-devel openssl-devel zlib-devel
yum install gcc perl-ExtUtils-MakeMaker
git --version
yum remove git
#安装下载新版本git
cd /usr/local
mkdir git
cd git
wget https://github.com/git/git/archive/v2.9.2.tar.gz
tar -xzvf v2.9.2.tar.gz
cd git-2.9.2
make prefix=/usr/local/git all
git -version
make prefix=/usr/local/git install
#配置git
vim /etc/profile
PATH="/usr/local/git/bin:$PATH"
export PATH
source /etc/profile
ln -s /usr/local/git/bin/git-upload-pack /usr/bin/git-upload-pack
ln -s /usr/local/git/bin/git-receive-pack /usr/bin/git-receive-pack
#添加一个git用户
groupadd git
useradd git -g git
passwd git
cd /etc/ssh/
chmod 600 shhd_config
vim shhd_config
RSAAuthentication yes
PubkeyAuthentication yes
AuthorizedKeysFile .ssh/authorized_keys
#=========================到此就已经部署好啦,测试一下
#在linux服务器上创建一个test.git库
cd /home/git
git init --bare test.git
#客户端测试
git clone root@localhsot:/home/git/test.git
linux上部署git服务器
最新推荐文章于 2025-03-23 10:59:38 发布