1.centos7安装git
yum install -y git
yum install -y git-daemon
2.初始化空目录仓库
mkdir /usr/local/git
mkdir /usr/local/git/projects
mkdir /usr/local/git/projects/test-projects.git
cd test-projects.git
git --bare init
3.修改目录权限
cd ..
chmod 775 test-projects.git/ -R
chmod g+s test-projects.git -R
set -m g:root:rwx test-projects.git
4.开启 git daemon 服务
git daemon --verbose --export-all --base-path=/usr/local/git/projects/test-projects.git/