Git 服务器搭建
上一章节中我们远程仓库使用了 Github,Github 公开的项目是免费的,但是如果你不想让其他人看到你的项目就需要收费。 这时我们就需要自己搭建一台Git服务器作为私有仓库使用。 接下来我们将以 Centos 为例搭建 Git 服务器。
1、安装Git
$ yum install curl-devel expat-devel gettext-devel openssl-devel zlib-devel perl-devel
$ yum install git$ groupadd git
$ useradd git -g git2、创建证书登录
$ cd /home/git/
$ mkdir .ssh
$ chmod 755 .ssh
$ touch .ssh/authorized_keys
$ chmod 644 .ssh/authorized_keys3、初始化Git仓库
$ cd /home
$ mkdir gitrepo
$ chown git:git gitrepo/
$ cd gitrepo
$ git init --bare codercto.git
Initialized empty Git repository in /home/gitrepo/codercto.git/4、克隆仓库
Last updated