Linux系统部署Git仓库(本地版)

来自CloudWiki
Cloud17讨论 | 贡献2019年5月27日 (一) 13:31的版本 (创建页面,内容为“==服务器端== ===安装Git=== yum install git -y 创建Git用户并设置密码(000000) useradd git passwd git ===创建仓库=== 创建仓库 su - git…”)
(差异) ←上一版本 | 最后版本 (差异) | 下一版本→ (差异)
跳转至: 导航搜索

服务器端

安装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@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

此时,需要的一个软件已经齐备,拍摄一下快照吧!

参考文档:[1]https://blog.51cto.com/lizhenliang/2159817