“Linux系统部署Git仓库(本地版)”的版本间的差异

来自CloudWiki
跳转至: 导航搜索
(创建页面,内容为“==服务器端== ===安装Git=== yum install git -y 创建Git用户并设置密码(000000) useradd git passwd git ===创建仓库=== 创建仓库 su - git…”)
 
第18行: 第18行:
 
==客户端==
 
==客户端==
 
客户端一般指开发者用的git节点 以及持续集成中Jenkins所在的服务器
 
客户端一般指开发者用的git节点 以及持续集成中Jenkins所在的服务器
===安装Git===
 
yum install git -y
 
 
创建Git用户并设置密码(000000)
 
 
useradd git
 
passwd git
 
 
 
===配置免密登录===
 
===配置免密登录===
 
*配置客户端所在的服务器免密登陆git仓库主机,可参考[[Linux配置SSH免密登录]]
 
*配置客户端所在的服务器免密登陆git仓库主机,可参考[[Linux配置SSH免密登录]]

2019年5月28日 (二) 07:34的版本

服务器端

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