Linux下配置yum本地仓库,怎么弄,

Linux下配置yum本地仓库,怎么弄,,第1张

mount /dev/cdrom /mnt #挂载系统光盘

vi /etc/yum.repos.d/cdrom

内容:

[cdrom]

name=system cdrom

baseurl=file:///mnt/

enabled=1

gpgcheck=0

这样就把yum源设到了系统光盘

1、环境准备

服务器:CentOS 7.3 + git (1.8.3.1)

客户端:win10 + git (2.17.0.windows.1)

2、服务器安装git

yum install -y git 

3、创建git用户,管理 git服务

[root@localhost home]# useradd git

[root@localhost home]# passwd git

4、服务器创建git 仓库

设置/home/git/repository-git 为git 服务器仓库,然后把 git 仓库的 owner 修改为 git 用户。

复制代码

[root@localhost git]# mkdir repository-git

[root@localhost git]# git init --bare repository-git/

Initialized empty Git repository in /home/git/repository-gt/

[root@localhost git]# chown -R git:git repository-git/

5、客户端安装git

下载 Git for Windows,地址:https://git-for-windows.github.io/

安装完之后,可以使用 Git Bash 作为命令行客户端。

5.1、选择一个目录 F:\project\sell 作为本地仓库,右键进入Git Bash 命令行模式

初始化本地仓库:git init

5.2、尝试克隆一个服务器的空仓库到本地仓库

git clone git@192.168.116.129:/home/git/repository-gt

第一次连接到目标 Git 服务器时会得到一个提示:

The authenticity of host '192.168.116.129(192.168.116.129)' can't be established.

RSA key fingerprint is SHA256:Ve6WV/SCA059EqoUOzbFoZdfmMh3B259nigfmvdadqQ.

Are you sure you want to continue connecting (yes/no)?

选择 yes:

Warning: Permanently added '192.168.116.129' (RSA) to the list of known hosts.

此时 C:\Users\用户名\.ssh 下会多出一个文件 known_hosts,以后在这台电脑上再次连接目标 Git 服务器时不会再提示上面的语句。


欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/yw/8487977.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2023-04-17
下一篇 2023-04-17

发表评论

登录后才能评论

评论列表(0条)

保存