1、服务器端安装httpd,git,gitweb等

1
#yum install httpd git git-daemon  gitweb

2、服务器端初始化仓库

1
2
3
#mkdir -p /data3/gitserver
#cd /data3/gitserver
#git init --bare git_repo #初始化一个裸仓库

3、向裸仓库提交初始文件

1
2
3
4
5
6
7
#cd /tmp
#git clone /data3/gitserver/git_repo
#cd git_repo
#touch MD
#git add MD
#git commit -m "init readme txt"  MD
#git push origin master

4、建立smart http协议,用户可以用http协议访问git仓库

1
2
#cd /etc/httpd/conf.d
#vim git.conf

添加如下配置文件

1
2
3
4
5
6
7
8
9
10
ScriptAlias /gitserver/ /usr/libexec/git-core/git-http-backend/
         
<Directory "/usr/libexec/git-core/">
  SetEnv GIT_PROJECT_ROOT /data3/gitserver
  SetEnv GIT_HTTP_EXPORT_ALL
  SetEnv REMOTE_USER=$REDIRECT_REMOTE_USER
  Options +ExecCGI
  Order allow,deny
  Allow from all
</Directory>

5、配置gitweb信息,可以用web访问git仓库;

1
#vim  /etc/gitweb.conf

输入git仓库的路径

1
2
3
4
# Set the path to git projects.  This is an absolute filesystem path which will
# be prepended to the project path.
#our $projectroot = "/var/lib/git";
$projectroot = "/data3/gitserver";

6、重启 httpd

1
2
#chkconfig httpd on
#service httpd start

7、查看git仓库

http://ip_address/git

8、clone git 仓库

1
git clone http://ip_address/gitserver/git_repo

9、如果push失败  ,到服务器作如下操作

1
2
3
4
#git push origin master
#如果git push 失败
#cd /data3/git_server/git_repo
# git config daemon.receivepack true

 

如果gitweb提示找不到项目,则可能是/usr/local/gerrit/git这个目录权限不够
 
配置支持gerrit
1、编辑配置文件
vim /data/gerrit/etc/gerrit.config
添加
[gitweb]
        cgi = /var/www/git/gitweb.cgi
2、重启gerrit

centos 安装http协议的git server的更多相关文章

  1. Windows下安装 msysGit 以及初始化 Git server环境

    Windows下git工具msysGit使用以及Git server初始化 Windows下git工具,这里选择msysGit,版本为msysGit-netinstall-1.8.1.2-previe ...

  2. CentOS安装sctp协议

    转自:http://blog.csdn.net/fly_yr/article/details/48375247 序 最近学习Unix网络编程,在第10章节,SCTP客户/服务器 程序实现时,发现很多由 ...

  3. centOs安装出现No package git available的解决办法

    来源地址 [http://chinacheng.iteye.com/blog/1825538 ] centos安装git 下载源代码安装后,git clone出现“fatal unable to fi ...

  4. Centos安装(更新)git(亲测有效)

    Centos 6.5默认安装的是git 1.7.X 版本,使用过程中会有一些奇怪的问题,对于用户名.密码支持不是很友好.将Centos6.5上的git更新到2.0.5,方法如下: 1.安装编译git时 ...

  5. CentOS 安装 Ansible 以及连接Windows server的办法

    1. CentOS机器上面按住那ansible yum install ansible 2. 安装 pywinrm  如果不安装 这个的话  ansible 会提示 没有 winrm 模块 注意需要先 ...

  6. Windows下搭建Git 服务器: BONOBO GIT SERVER + TortoiseGit

    本文将介绍如何在Windows操作系统下搭建Git服务器和客户端.服务器端采用的是Bonobo Git Server,一款用ASP.NET MVC开发的Git源代码管理工具,界面简洁,基于Web方式配 ...

  7. CentOS安装Git实现多人同步开发

    描 述 要开发一个"cms系统",有2个人分别是:晓飞, 盈月.要求使用Git来进行版本控制. 项目信息 版本控制:Git 项目名称:cms 开发人员:xiaofei,yingyu ...

  8. 【推荐】CentOS安装Subversion-1.8.11+HTTP协议支持配置

    注:以下所有操作均在CentOS 6.5 x86_64位系统下完成. 我们需要搭建一个自己的SVN服务器. 此外,搭建好的SVN服务器除了需要支持svn协议外,最好还需要支持HTTP协议和HTTPS协 ...

  9. ubuntu 14.04 安装git server

    版本信息 ubuntu : 14.04.1 git version 1.9.1 perl v5.10.1 ssh OpenSSH_6.6.1p1 本次安装的git server使用gitolite实现 ...

随机推荐

  1. 安卓动画之ObjectAnimator

    ObjectAnimator 不仅仅移动位置,还移动了对象view 先来代码片段: //Y轴变换 ObjectAnimator oa = ObjectAnimator.ofFloat(imageVie ...

  2. I-frame、B-frame、P-frame及DTS、PTS的关系(转)

    基本概念: I frame :帧内编码帧 又称intra picture,I 帧通常是每个 GOP(MPEG 所使用的一种视频压缩技术)的第一个帧,经过适度地压缩,做为随机访问的参考点,可以当成图象. ...

  3. 消息队列与RabbitMQ

    1 什么是消息队列 消息指进程或应用间通信的数据:队列是保存数据的结构:消息队列是指进程或应用间通信时,保存消息的容器.消息队列独特的机制和结构保证了消息发送者和接收者之间良好的异步通信. 2 为什么 ...

  4. c++builder CryptoAPI md5

    #include <wincrypt.h> DWORD GetHash( CONST BYTE * pbData, DWORD dwDataLen, ALG_ID algId, LPTST ...

  5. 2d网络游戏的延迟补偿(Lag compensation with networked 2D games)

    http://gamedev.stackexchange.com/questions/6645/lag-compensation-with-networked-2d-games ——————————— ...

  6. JSF 2 link, commandLink and outputLink example

    In JSF, <h:link />, <h:commandLink /> and <h:outputLink /> tags are used to render ...

  7. 微软IOC容器Unity简单代码示例2-配置文件方式

    @(编程) 1. 通过Nuget下载Unity 这个就不介绍了 2. 接口代码 namespace UnityDemo { interface ILogIn { void Login(); } } n ...

  8. linux之间连接—使用SSH

    菜鸟学linux笔记.本机是linux,需要远程连接linux,使用SSH (1)在终端,输入命令:ssh root@110.110.100.100 root为用户名,110.110.100.100为 ...

  9. zoj3591 Nim(Nim博弈)

    ZOJ 3591 Nim(Nim博弈) 题目意思是说有n堆石子,Alice只能从中选出连续的几堆来玩Nim博弈,现在问Alice想要获胜有多少种方法(即有多少种选择方式). 方法是这样的,由于Nim博 ...

  10. Odoo Qweb报表css丢失问题

    有时候我们恢复过来的数据库在打印原来系统的Qweb报表的时候会发现所有的样式都丢失了,只打印内容出来. 这时候我们可以进入Setting/ Technical / Paramters / System ...