一、下载git并安装; wget https://www./pub/software/scm/git/git-2.9.5.tar.gz tar git-2.9.5.tar.gz tar zxvf git-2.9.5.tar.gz cd git-2.9.5 ./configure --prefix=/usr/local/git make clean make make install 中间可能会有报错,按提示安装相应的依赖包,不同的服务器可能不同,我这里是: yum install perl-ExtUtils-MakeMaker yum install gettext-devel 查看git版本 git --version 二、添加git用户账号 groupadd git useradd git -g git cd /home/git passwd git 拿掉用户操作权限/bin/bash,只给git-shell操作权限/usr/local/git/bin/git-shell vim /etc/passwd 三、新建git仓库并初始化 mkdir repo.git cd repo.git/ git init --bare cd .. chown -R git:git repo.git/
|
|
来自: 昵称10020212 > 《待分类》