打开APP
userphoto
未登录

开通VIP,畅享免费电子书等14项超值服

开通VIP
git
Git Manual
1.         server端安装Git
CentOS release 6.2 (Final)
Linux localhost 2.6.32-220.el6.x86_64 #1 SMP Tue Dec 6 19:48:22 GMT 2011 x86_64 x86_64 x86_64 GNU/Linux
vi /etc/selinux/config
SELINUX=disabled
reboot
service iptables stop
chkconfig iptables off
rpm -Uvh mod_wsgi-3.3-7.1.x86_64.rpm
rpm -e git-1.7.1-2.el6_0.1.x86_64 perl-Git-1.7.1-2.el6_0.1.noarch
tar zxvf git-1.7.12.4.tar.gz
cd git-1.7.12.4
make clean
./configure --prefix=/usr
make;make install
git --version
2.         安装git-http-backend
3.         安装gitolite
cd
mkdir /var/www/gitolite-home
export GITOLITE_HTTP_HOME
GITOLITE_HTTP_HOME=/var/www/gitolite-home
PATH=$GITOLITE_HTTP_HOME/bin:$PATH
tar zxvf gitolite-2.3.1.tar.gz
cd gitolite-2.3.1/
GHH=$GITOLITE_HTTP_HOME
mkdir -p $GHH/bin $GHH/share/gitolite/conf $GHH/share/gitolite/hooks
src/gl-system-install $GHH/bin $GHH/share/gitolite/conf $GHH/share/gitolite/hooks
vi /var/www/gitolite-home/share/gitolite/conf/example.gitolite.rc
在文件开头增加
$ENV{GIT_HTTP_BACKEND} = “/usr/libexec/git-core/git-http-backend”;
$ENV{PATH} = “$ENV{GITOLITE_HTTP_HOME}/bin:$ENV{PATH}”;
gl-setup sitaram
chown -R apache.apache $GITOLITE_HTTP_HOME
vi /etc/httpd/conf/httpd.conf
NameVirtualHost *:80
vi /etc/httpd/conf.d/gitolite.conf
<VirtualHost *:80>
ServerName scm12.test.cn
SetEnv GIT_PROJECT_ROOT /var/www/gitolite-home/repositories
SetEnv GIT_HTTP_EXPORT_ALL
ScriptAlias /git/ /var/www/gitolite-home/bin/gl-auth-command/
SetEnv GITOLITE_HTTP_HOME /var/www/gitolite-home
<Location /git>
AuthType Basic
AuthName “Private Git Access”
Require valid-user
AuthUserFile /data/git.conf/passwd
#AuthGroupFile /data/git.conf/group
</Location>
</VirtualHost>
mkdir -p /data/git.conf
touch /data/git.conf/passwd
htpasswd -b /data/git.conf/passwd sitaram 11111
htpasswd -b /data/git.conf/passwd test 11111
htpasswd -b /data/git.conf/passwd wangjian 11111
mv /var/www/gitolite-home/repositories/ /data/git/
ln -s /data/git/ /var/www/gitolite-home/repositories
service httpd configtest
service httpd start
cd /data
git clone http://sitaram:11111@127.0.0.1/git/gitolite-admin.git
cd gitolite-admin
vi conf/gitolite.conf
repo    gitolite-admin
RW+     =   sitaram wangjian
git commit -a -m "add admin"
git push
http://172.16.10.72/git/
4.         测试
cd
git clone http://test:11111@127.0.0.1/git/testing.git
cd testing
touch readme
git add readme
git commit -m “first commit”
git push origin master
5.         建新库
cd /data/git/
cp -a testing.git test2.git
cd /data/gitolite-admin/
vi conf/gitolite.conf
repo test2
RW+ = @all
git commit -a -m “add new repo”
git push
6.         client端安装Git
linux
同上
windows
安装Git-1.8.3-preview20130601.exe
默认安装
安装TortoiseGit-1.8.3.0-32bit.msi
安装步骤到下图时选择”OpenSSH,Git default SSH Client”即可。其它步骤默认就行!
http://www.ossxp.com/doc/git/gitolite.html
http://blog.csdn.net/gracioushe/archive/2010/09/29/5915352.aspx
http://roclinux.cn/?p=184
http://surpass-li.iteye.com/blog/1052311
https://github.com/sitaramc/gitolite/blob/pu/doc/http-backend.mkd
http://www.kernel.org/pub/software/scm/git/docs/git-http-backend.html
http://kasunh.wordpress.com/2011/01/15/git-over-https/
http://serverfault.com/questions/205207/ubuntu-git-git-http-backend-and-apache
http://www.tsingfeng.com/?p=656
http://www.jedi.be/blog/2009/05/06/8-ways-to-share-your-git-repository/#apachehttp
http://mattiasgeniar.be/2011/03/04/centos-git-http-push-unavailable-git-not-compiled-with-use_curl_multi/
http://fallenlord.blogbus.com/logs/71511589.html
http://gitstory.wordpress.com/
7.         安装ldap
vi /etc/httpd/conf.d/gitolite.conf
<VirtualHost *:80>
ServerName scm12.test.cn
SetEnv GIT_PROJECT_ROOT /var/www/gitolite-home/repositories
SetEnv GIT_HTTP_EXPORT_ALL
ScriptAlias /git/ /var/www/gitolite-home/bin/gl-auth-command/
SetEnv GITOLITE_HTTP_HOME /var/www/gitolite-home
<Location /git>
AuthType Basic
AuthName “Private Git Access”
Require valid-user
AuthBasicProvider ldap
AuthzLDAPAuthoritative off
AuthLDAPBindDN “cn=Manager,dc=example,dc=com”
AuthLDAPBindPassword “mmjjjj”
AuthLDAPUrl “ldap://172.16.10.181:30251/ou=People,dc=example,dc=com?uid?sub?(objectClass=*)”
#AuthUserFile /data/git.conf/passwd
#AuthGroupFile /data/git.conf/group
</Location>
</VirtualHost>
service httpd restart
http://linuxadminzone.com/how-to-setup-git-http-authentication-using-ldap-in-apache/
8.         安装gitweb
由于gitolite不能基于路径/分支控制gitweb浏览的权限,对于要求严格权限的情况,就不要用gitweb了。
cd
cd git-1.7.12.4
make gitwebdir=/var/www/cgi-bin/gitweb install-gitweb
vi /var/www/cgi-bin/gitweb/gitweb_config.perl
$projectroot = "/var/www/gitolite-home/repositories";
vi /etc/httpd/conf.d/gitolite.conf
<VirtualHost *:80>
ServerName scm12.test.cn
SetEnv GIT_PROJECT_ROOT /var/www/gitolite-home/repositories
SetEnv GIT_HTTP_EXPORT_ALL
SetEnv GITOLITE_HTTP_HOME /var/www/gitolite-home
ScriptAlias /git/ /var/www/gitolite-home/bin/gl-auth-command/
Alias /gitweb /var/www/cgi-bin/gitweb/
<Directory "/var/www/cgi-bin/gitweb">
AddHandler cgi-script .cgi
DirectoryIndex gitweb.cgi
Options FollowSymlinks ExecCGI
AllowOverride None
Order allow,deny
Allow from all
</Directory>
<Location />
AuthType Basic
AuthName "Private Gitweb Access"
AuthBasicProvider ldap
AuthzLDAPAuthoritative off
AuthLDAPBindDN "cn=Manager,dc=example,dc=com"
AuthLDAPBindPassword "mmjjjj"
AuthLDAPUrl "ldap://172.16.10.181:30251/ou=People,dc=example,dc=com?uid?sub?(objectClass=*)"
Require valid-user
#AuthUserFile /data/git.conf/passwd
</Location>
</VirtualHost>
service httpd restart
http://172.16.10.72/gitweb/
http://www.techsiteanalytics.com/index.php/2012/09/05/3477
http://blog.csdn.net/renyan20053295/article/details/7188312
http://gitolite.com/gitolite/g2/ggshb.html
https://github.com/git/git/blob/v1.7.6/Documentation/git-http-backend.txt
https://github.com/git/git/blob/v1.7.6/gitweb/README
https://github.com/sitaramc/gitolite/blob/v2.0.1/doc/http-backend.mkd
http://swarm.cs.pub.ro/~razvan/blog/gitweb-access-to-git-repositories/
http://swarm.cs.pub.ro/~razvan/blog/http-repository-sharing-asides-gitweb/
http://sethrobertson.github.io/HowToPutGitOnTheWeb/GitOnTheWeb.html
https://gist.github.com/karmi/484199
http://mesouug.ru/index.php/GIT
https://gist.github.com/iphoting?page=3
https://gist.github.com/iphoting/3102634
9.         gitmanager
http://www.oschina.net/p/git+manager/similar_projects?lang=0&sort=time&p=13
http://labs.softjourn.com/projects/gitmanager
本站仅提供存储服务,所有内容均由用户发布,如发现有害或侵权内容,请点击举报
打开APP,阅读全文并永久保存 查看更多类似文章
猜你喜欢
类似文章
Window下使用msysgit和apache配置Git服务
GitWeb
玩转Linux(2)——搭建GitWeb
centos6.5下Zabbix系列之Zabbix安装搭建及汉化
Git服务器的搭建全部功略
svn server
更多类似文章 >>
生活服务
热点新闻
分享 收藏 导长图 关注 下载文章
绑定账号成功
后续可登录账号畅享VIP特权!
如果VIP功能使用有故障,
可点击这里联系客服!

联系客服