如何在局域网中部署git服务器(gitblit windows)

发布于 2019-09-26 作者 风铃 27次 浏览 版块 前端

 


Git是现在很流行的分布式版本控制工具,github更是人人皆知。但是github要求能够访问互联网。遇到不能访问互联网的情况,难道只能望git兴叹了。还好开源软件给我们提供了选择,比如Gitblit、GitStack、Gitolite,其中GitStack貌似不能安装在windowsXP上。


         最终考虑简单便捷,我选择Gitblit的Go分支做服务器——这个分支版本的好处就是什么都集成到一块了,不需要安装别的东西。关于Gitblit Go的安装配置文档也不少,但是自己在安装配置过程还是遇到了一些问题。


 


         安装配置过程:


1.     下载Gitblit的Go分支并解压到本地就可以了,不需要安装。由于Gitblit是用Java开发的,所以记得先安装Java运行时。


2.      配置Gitblit目录下的\data\gitblit.properties文件,最基础的配置方式如下


 



  • 本地代码库的位置


 



git.repositoriesFolder= D:/gitRep


注意目录必须要用“/”而不是“\”。



 



  • 配置访问的端口号,使用推荐值或默认值即可


 



server.httpPort = 8080


server.httpsPort=8443



 



  • 配置http和https访问的接口,默认值是localhost,如果想要从其它电脑访问,赋空值就可以。


 



server.httpBindInterface=


server.httpsBindInterface=


 



3.      运行Gitblit目录下的gitblit.cmd就可以开启服务器了。


 


 


 


 


Gitblit介绍


What is Gitblit?


Gitblit is an open-source, pure Java stack for managing, viewing, and serving Git repositories.
It's designed primarily as a tool for small workgroups who want to host centralized repositories.


GO: Single-Stack Solution


Gitblit GO is an integrated, single-stack solution based on Jetty.


You do not need Apache httpd, Perl, Git, or Gitweb. Should you want to use some or all of those, you still can; Gitblit plays nice with the other kids on the block.


This is what you should download if you want to go from zero to Git in less than 5 mins.


WAR: For Your Servlet Container


Gitblit WAR is what you should download if you already have a servlet container available that you wish to use. Jetty 6/7/8 and Tomcat 67 are known to work. Generally, any Servlet 2.5 or Servlet 3.0 container should work.


You decide how to use Gitblit


Gitblit can be used as a dumb repository viewer with no administrative controls or user accounts.
Gitblit can be used as a complete Git stack for cloning, pushing, and repository access control.
Gitblit can be used without any other Git tooling (including actual Git) or it can cooperate with your established tools.


All Transports


The SSH, HTTP, & GIT protocols are supported and ready-to-go out of the box.


Issue tracking with branch-based pull requests


Gitblit blends elements of GitHub, BitBucket, and Gerrit to provide a streamlined collaboration workflow based on branches within the primary repository.


 


 


 










收藏
暂无回复