centos搭建git服务

一、服务器
yum -y install git

git init --bare test.git
cd test.git
pwd  //打印当前目录,假设是:/home/root/git/test.git
git remote add origin ssh://$USER@IP地址:端口号/$(pwd)

二、另一端客户端电脑:
git clone ssh://root@IP地址:端口号/home/root/git/test.git

原文地址:https://www.cnblogs.com/wujinhong/p/7620209.html