Git服务器搭建
2019-11-27 本文已影响0人
s1991721
安装git
yum install -y git
查看git版本
git --version

也可自选版本下载tar.gz文件解压安装,但需要配置环境变量,安装其他依赖工具,详情咨询:腾讯云教程
创建用户
用户会在home目录下存在文件夹


创建仓库
创建项目路径




--bare 意为创建裸仓库

修改文件所有者

操作仓库
clone远端仓库,需要输入仓库文件所有者的密码

为避免每次输入密码,需在服务端配置打开RSA认证

编辑sshd_config,开启设置

根据配置文件显示路径,创建文件

修改所有者


将客户端公钥传入服务端

修改文件权限

禁止git用户登陆服务器
vi /etc/passwd

固定IP
名字少许差异


重启网络服务

用CentOS搭建git玩玩就算了,最终还是决定用Windows做