Git服务器搭建
Git服务器可以搭建在windows,也可以搭建在Linux中,由于windows中copssh登录git服务器软件已经收费,免费版本有很多缺点。因此把git服务器搭建在Linux中。
依赖环境
Git需要很多依赖环境:因此安装git需要先安装下列软件:
[root@itcast-01 ~]# yum install curl-devel expat-devel gettext-devel openssl-devel zlib-devel perl-devel gcc-c++
安装git
上传git安装包:
安装包:git-2.9.3.tar.gz
tar -xvf git-2.9.3.tar.gz
安装命令:(进入git解压目录)
[root@itcast-01 git-2.9.3]# make prefix=/usr/local all
[root@itcast-01 git-2.9.3]# make prefix=/usr/local install
创建git用户
添加Linux的用户,用户名为git的用户:
[root@itcast-01 ~]# useradd git
设置git用户的密码
[root@itcast-01 ~]# passwd git
切换到git用户
[root@itcast-01 ~]# su - git
初始化仓库
初始化仓库,仓库名为taotao.git:
[git@itcast-01 root]$ cd
[git@itcast-01 ~]$ git init --bare taotao.git
始化空的 Git 仓库于 /home/git/taotao.git/