搭建git私有仓库
前言
搭建github私有仓库
[root@localhost ~]# yum install -y git[root@localhost ~]# useradd -s /usr/bin/git-shell git[root@localhost ~]# cd /home/git/
[root@localhost ~]# mkdir .ssh
[root@localhost ~]# touch .ssh/authorized_keys
[root@localhost ~]# chown -R git.git .ssh
[root@localhost ~]# chmod 600 .ssh/authorized_keys[root@localhost git]# mkdir /data/gitroot
[root@localhost git]# cd /data/gitroot/
[root@localhost git]#git init --bare sample.git
# 会创建一个裸仓库,裸仓库没有工作区,因为服务器上的Git仓库纯粹是为了共享,
# 所以不让用户直接登录到服务器上去改工作区,并且服务器上的Git仓库通常都以.git结尾
[root@localhost git]# chown -R git.git sample.git客户端使用
最后更新于