汽车网站开发毕业设计论文,东营会计信息网官网首页,沈阳搜索排名公司,企业所得税优惠政策最新2023税率目录 1、安装Git
2、创建证书登录
3、初始化Git仓库
4、克隆仓库 上一章节中我们远程仓库使用了 Github#xff0c;Github 公开的项目是免费的#xff0c;2019 年开始 Github 私有存储库也可以无限制使用。
当然我们也可以自己搭建一台 Git 服务器作为私有仓库使用。
接…目录 1、安装Git
2、创建证书登录
3、初始化Git仓库
4、克隆仓库 上一章节中我们远程仓库使用了 GithubGithub 公开的项目是免费的2019 年开始 Github 私有存储库也可以无限制使用。
当然我们也可以自己搭建一台 Git 服务器作为私有仓库使用。
接下来我们将以 Centos 为例搭建 Git 服务器。
1、安装Git
$ yum install curl-devel expat-devel gettext-devel openssl-devel zlib-devel perl-devel$ yum install git
接下来我们 创建一个git用户组和用户用来运行git服务
$ groupadd git$ useradd git -g git
2、创建证书登录
收集所有需要登录的用户的公钥公钥位于id_rsa.pub文件中把我们的公钥导入到/home/git/.ssh/authorized_keys文件里一行一个。
如果没有该文件创建它
$ cd /home/git/$ mkdir .ssh$ chmod 755 .ssh$ touch .ssh/authorized_keys$ chmod 644 .ssh/authorized_keys
3、初始化Git仓库
首先我们选定一个目录作为Git仓库假定是/home/gitrepo/runoob.git在/home/gitrepo目录下输入命令
$ cd /home$ mkdir gitrepo$ chown git:git gitrepo/$ cd gitrepo
$ git init --bare runoob.gitInitialized empty Git repository in /home/gitrepo/runoob.git/ 以上命令Git创建一个空仓库服务器上的Git仓库通常都以.git结尾。然后把仓库所属用户改为git
$ chown -R git:git runoob.git
4、克隆仓库
$ git clone git192.168.45.4:/home/gitrepo/runoob.gitCloning into runoob...warning: You appear to have cloned an empty repository.Checking connectivity... done.
192.168.45.4 为 Git 所在服务器 ip 你需要将其修改为你自己的 Git 服务 ip。
这样我们的 Git 服务器安装就完成。