Linux系统部署Git仓库
来自CloudWiki
服务器端
安装Git
yum install git -y
创建Git用户并设置密码(000000)
useradd git passwd git
创建仓库
创建仓库
su - git mkdir solo.git cd solo.git git --bare init
客户端
客户端一般指开发者用的git节点 以及持续集成中Jenkins所在的服务器
安装Git
yum install git -y
创建Git用户并设置密码(000000)
useradd git passwd git
配置免密登录
- 配置客户端所在的服务器免密登陆git仓库主机,可参考Linux配置SSH免密登录
远程访问仓库
访问创建的这个仓库
[git@localhost solo.git]$ cd ~ [git@localhost ~]$ git clone git@10.0.0.30:/home/git/solo.git Cloning into 'solo'... The authenticity of host '10.0.0.30 (10.0.0.30)' can't be established. ECDSA key fingerprint is SHA256:RD84aAyqeq7pOdIdHHxVnm11Lds1BB4oLcM8AJblbVI. ECDSA key fingerprint is MD5:4d:90:d2:5f:7d:01:39:da:c8:60:47:96:07:d1:f5:cd. Are you sure you want to continue connecting (yes/no)? yes Warning: Permanently added '10.0.0.30' (ECDSA) to the list of known hosts. git@10.0.0.30's password: warning: You appear to have cloned an empty repository. [git@localhost ~]$ ls solo solo.git [git@localhost ~]$ ls solo [git@localhost ~]$ ls solo.git branches config description HEAD hooks info objects refs
此时,需要的一个软件已经齐备,拍摄一下快照吧!