六狼论坛

 找回密码
 立即注册

QQ登录

只需一步,快速开始

新浪微博账号登陆

只需一步,快速开始

搜索
查看: 60|回复: 0

安装git服务器

[复制链接]

升级  7.33%

15

主题

15

主题

15

主题

秀才

Rank: 2

积分
61
 楼主| 发表于 2013-1-28 22:10:57 | 显示全部楼层 |阅读模式
最近买了个国外的VPS 用作FQ之余还准备搭个git仓库。在这里记录搭建的过程。
 
 
安装GIT

添加webtatic yum库,上面有最新版的git包
$ sudo rpm -Uvh http://repo.webtatic.com/yum/centos/5/latest.rpm 
安装git:
$ sudo yum install --enablerepo=webtatic git  
SSH密钥

检查~/.ssh目录下是否有id_rsa和id_rsa.pub文件
 
$ ls ~/.sshid_rsa  id_rsa.pub  
有则跳过,没有则生成新的:
 
$ ssh-keygen Generating public/private rsa key pair.Enter file in which to save the key (/home/jarod/.ssh/id_rsa): Created directory '/home/jarod/.ssh'.Enter passphrase (empty for no passphrase): Enter same passphrase again: Your identification has been saved in /home/jarod/.ssh/id_rsa.Your public key has been saved in /home/jarod/.ssh/id_rsa.pub.The key fingerprint is:90:4a:49:4b:2d:35:0d:66:aa:5e:d7:b8:d5:39:45:ea jarod@vps 
 
把id_rsa.pub上传到服务器
 
$ scp ~/.ssh/id_rsa.pub root@server_ip:/tmp/jarod.pub  
 
安装gitolite

 
$ git clone git://github.com/sitaramc/gitolite$ cd gitolite$ sudo ./src/gl-system-install$ sudo useradd git         # 添加git用户$ sudo su git                   # 用git用户进行安装$ gl-setup /tmp/jarod.pub 
 
安装完成后默认会有两个git库
gitolite-admin - gitolite所有管理工作都只需要对这个库进行操作,包括库管理,用户管理,权限管理
testing - 测试练手用的库
 
把gitolite-admin clone到自己本机上
 
$ git clone git@server_ip:gitolite-admin 在本机修改gitolite-admin的配置,commit并push到服务器上即可生效
 
 
您需要登录后才可以回帖 登录 | 立即注册 新浪微博账号登陆

本版积分规则

快速回复 返回顶部 返回列表