root用户下安装依赖
[root@myw ~]# yum install curl-devel expat-devel gettext-devel openssl-devel zlib-devel perl-devel
安装git
[root@myw ~]# yum install git
[root@myw ~]# git version
创建git用户
[root@myw ~]# groupadd git
[root@myw ~]# adduser git -g git
[root@myw ~]# passwd git
[root@myw ~]# su git
[git@myw root]$ cd /home/git
创建证书
[git@myw ~]$ mkdir .ssh
[git@myw ~]$ chmod 700 .ssh
[git@myw ~]$ cd .ssh
[git@myw .ssh]$ touch authorized_keys
[git@myw .ssh]$ chmod 600 authorized_keys
[git@myw .ssh]$ ssh-keygen -t rsa -C '<邮箱>'
创建仓库
[git@myw root]$ cd /home/git
[git@myw ~]$ mkdir gitrepo
[git@myw ~]$ cd gitrepo
[git@myw gitrepo]$ git init --bare project.git
Git Bash Here 客户端克隆仓库
$ git clone git@192.168.1.180:/home/git/gitrepo/project.git
Cloning into 'project'...
git@192.168.1.180's password:
warning: You appear to have cloned an empty repository.