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

posted @ 2017-10-02 15:37  风别鹤  阅读(116)  评论(0编辑  收藏  举报