版本控制管理是持续集成(CI)中一个重要的环节。时下,最流行的SCM当属GIT。在GIT服务器中,gitolite是一个小巧而易用的服务器。相比github,它并不强大,但企业内部做CI,绝对胜任。
本文介绍gitolite最新版本3.3的安装和配置。
gitolite是perl开发的git server 地址为:https://github.com/sitaramc/gitolite。
GITolite服务器信息
主机名:meridians-gitolite
IP:192.168.0.140
系统:Ubuntu 12.10
另有一台客户端,这里是hanl@hanl-ubuntu1204
1.SSH设置
1.1.[server:meridians-gitolite]安装openssh-server
sudo apt-get install openssh-server
1.2.[client:hanl-ubuntu1204]测试连接
eric@meridians-jenkins-master:~$ ssh eric@192.168.0.140
The authenticity of host '192.168.0.140 (192.168.0.140)' can't be established.
ECDSA key fingerprint is e3:28:c5:b0:82:da:47:2f:34:30:bd:11:95:22:4f:4d.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '192.168.0.140' (ECDSA) to the list of known hosts.
eric@192.168.0.140's password:
Welcome to Ubuntu 12.10 (GNU/Linux 3.5.0-17-generic x86_64)
* Documentation: https://help.ubuntu.com/
Last login: Sat Feb 2 05:43:10 2013 from 192.168.0.102
eric@meridians-gitolite:~$ exit
本文原创地址:http://feuyeux.iteye.com/blog/1797261
2.登录git server
hanl@hanl-ubuntu1204:~$ ssh eric@192.168.0.140
2.1.安装GIT
sudo apt-get install git
git config --global user.name "Eric Han"
git config --global user.email "feuyeux@gmail.com"
(2.2.GIT代理 如果企业内部设置了代理服务器,GIT使用的端口会被封杀,需要走代理)
2.2.1.安装
sudo apt-get install socat
2.2.2.创建socat脚本
cd /home/git
sudo nano git-proxy.sh
#!/bin/bash
socat STDIO PROXY:10.11.70.71:$1:$2,proxyport=80
sudo chmod 777 git-proxy.sh
2.2.3.配置git代理
sudo nano /etc/profile
export GIT_PROXY_COMMAND=/home/git/git-proxy.sh
source /etc/profile
2.3.创建用户git
sudo adduser git
2.4.使用git身份
su git
cd ~
2.5.安装gitolite
git clone git://github.com/sitaramc/gitolite
mkdir -p ~/bin
gitolite/install -to ~/bin
nano .bashrc
PATH=/home/git/bin:$PATH
ctrl+o ctrl+x
source .bashrc
2.6.测试
gitolite help
hello, this is gitolite3 v3.3-10-g293df79 on git 1.7.9.5
2.7.退出git帐号 退出SSH登录
exit
exit
本文原创地址:http://feuyeux.iteye.com/blog/1797261
3.SSH证书
3.1.生成公私钥
hanl@hanl-ubuntu1204:~$ ssh-keygen -f ~/.ssh/han
3.2.拷贝证书到git server
sudo scp ~/.ssh/han.pub git@192.168.0.140:/tmp/han.pub
3.3.安装证书到gitolite
ssh git@192.168.0.140
gitolite setup -pk /tmp/han.pub
Initialized empty Git repository in /home/git/repositories/gitolite-admin.git/
Initialized empty Git repository in /home/git/repositories/testing.git/
WARNING: /home/git/.ssh/authorized_keys missing; creating a new one
3.4.退出SSH登录
exit
本文原创地址:http://feuyeux.iteye.com/blog/1797261
4.配置SSH无密码登录
hanl@hanl-ubuntu1204:~$ sudo nano ~/.ssh/config
# gitolite server
host gito
user git
hostname 192.168.0.140
port 22
IdentityFile ~/.ssh/han
本文原创地址:http://feuyeux.iteye.com/blog/1797261
5.克隆GITolite管理
hanl@hanl-ubuntu1204:~$ git clone gito:gitolite-admin.git
Cloning into 'gitolite-admin'...
remote: Counting objects: 6, done.
remote: Compressing objects: 100% (4/4), done.
remote: Total 6 (delta 0), reused 0 (delta 0)
Receiving objects: 100% (6/6), done.
hanl@hanl-ubuntu1204:~$ cat gitolite-admin/conf/gitolite.conf
repo gitolite-admin
RW+ = han
repo testing
RW+ = @all
本文原创地址:http://feuyeux.iteye.com/blog/1797261
6.管理GIT项目
6.1编辑
hanl@hanl-ubuntu1204:~$ nano gitolite-admin/conf/gitolite.conf
repo gitolite-admin
RW+ = han
repo testing
RW+ = @all
repo airfactory
RW+=@all
6.2.提交
hanl@hanl-ubuntu1204:~$ cd gitolite-admin/
git commit -a -m "add airfactory repo"
git push
6.3.验证
ssh git@192.168.0.140
git@utfteam-virtual-machine:~$ ls repositories/
airfactory.git gitolite-admin.git testing.git
exit
6.4.检出
hanl@hanl-ubuntu1204:~$ git clone gito:airfactory
Cloning into 'airfactory'...
warning: You appear to have cloned an empty repository.
本文原创地址:http://feuyeux.iteye.com/blog/1797261
7.安装gitweb
sudo apt-get install highlight gitweb
The following extra packages will be installed:
apache2 apache2-mpm-worker apache2-utils apache2.2-bin apache2.2-common highlight-common libapr1 libaprutil1
libaprutil1-dbd-sqlite3 libaprutil1-ldap
Suggested packages:
apache2-doc apache2-suexec apache2-suexec-custom httpd-cgi libcgi-fast-perl git-doc
The following NEW packages will be installed:
apache2 apache2-mpm-worker apache2-utils apache2.2-bin apache2.2-common gitweb highlight highlight-common
libapr1 libaprutil1 libaprutil1-dbd-sqlite3 libaprutil1-ldap
0 upgraded, 12 newly installed, 0 to remove and 210 not upgraded.
Need to get 2,371 kB of archives.
sudo nano /etc/apache2/apache2.conf
append:
ServerName 127.0.0.1
sudo /etc/init.d/apache2 restart
sudo nano /etc/gitweb.conf
append:
$feature{'highlight'}{'default'} = [1];
sudo usermod -a -G git www-data
sudo chmod g+r /home/git/projects.list
sudo chmod -R g+rx /home/git/repositories
sudo service apache2 restart
/etc/gitweb.conf
$projectroot = "/home/git";
chmod755 /home/git
home/git/.gitolite.rc
umask 0000
chmod -R 777 /home/git/repositories
chmod 755 /home/git/projectlist
http://192.168.0.140/gitweb/
nano gitolite-admin/conf/gitolite.conf
append:
repo gitweb
RW+ = @all
hanl@hanl-ubuntu1204:~/gitolite-admin$ git commit -a -m "add gitweb repo"
git push
更多敏捷研究,请关注:https://github.com/feuyeux/meridians
相关推荐
Rational Software Architect RSA 9.0 安装Android SDK ADT时,出错,不能下载。这是补丁,覆盖掉IBMIMShared下面这2个目录里的文件,注意:需要带目录覆盖
很详细的RSA9的安装文档,欢迎大家前来下载!
Sencha Architect 3 注册码Sencha Architect 3 注册码Sencha Architect 3 注册码Sencha Architect 3 注册码Sencha Architect 3 注册码Sencha Architect 3 注册码
Architect 3D 2017简称3D建筑师,是一款非常好用且功能强大的专业3D图形制作软件,软件提供了丰富实用的功能,可以用于各类建筑制图、室内设计制图的制作,内置了丰富的方案供用户选择,同时还提供了一个向导来供...
SenchaArchitect 3(5-3)
Enterprise Architect是以目标为导向的软件系统。它覆盖了系统开发的整个周期,除了开发类模型之外,还包括事务进程分析,使用案例需求,动态模型,组件和布局,系统管理,非功能需求,用户界面设计,测试和维护等。...
Enterprise Architect 破解版 Enterprise Architect 破解版 Enterprise Architect 破解版 Enterprise Architect 破解版
本自述文件包含安装和配置功能齐全的Arch Linux安装的步骤,该安装包含桌面环境,所有支持包(网络,蓝牙,音频,打印机等),我的首选应用程序和实用程序。 此仓库中的shell脚本允许整个过程自动化。 从头开始安装...
提供 Enterprise Architect安装+WD 。 Enterprise Architect 15是一款强大的UML建模仿真软件,软件是以目标为导向的软件系统。是以目标为导向的软件系统。
SenchaArchitect 3.0.4绿色版
Advanced Installer Architect是一款高级的安装程序打包工具,我们有时候可能用nsis用的多,Advanced Installer Architect也是一款打包工具,有兴趣的朋友也可以试试。有了Advanced Installer Architect你就可以创建...
Sencha Architect2.2.2入门操作图解教程, 自己做一个Extjs4动态打开页面的程序,是在Sencha Architect2.2.2下完成的,附有详细图解教程和源码.
前端开源库-architect-build通过源映射和增量更新支持,架构师构建、连接和修改架构师配置到一个文件中。
rational software architect licensen
Enterprise Architect 破解补丁 亲测可破解 EA10
Enterprise Architect 详细使用教程,包含组建解释。
Enterprise Architect V7.5 汉化工具 安装玩Enterprise Architect 7.5后直接安装该工具,即可实现汉化! 该文件是exe文件
Borland Delphi 2005 Architect Update 3----------Report #: Short Description: Rating: Status12241 IntToHex returns lowercase letters0.00 of 5 Closed11881 TStringStream constructor for .NET sets ...
对于软件设计的初学者来说,面对大量的信息,往往不知从何处开始下手。《UML与EnterpriseArchitect7.5团队开发实务手册》是根据作者多年的授课经验写作而成的,特别针对有以下需求的读者,提供学习的指引。
目录 一.EA简介 二.创建新项目 三.EA软件配置 四.用例图,类图的使用 五.其他图形的使用 六.数据建模 七.代码工程 .....