设为首页 收藏本站
查看: 2089|回复: 0

[经验分享] 如何在局域网中部署git服务器(gitblit windows)

[复制链接]

尚未签到

发表于 2017-2-28 11:10:35 | 显示全部楼层 |阅读模式
  Gitblit的安装配置及访问-windows
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 6/7 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.
  将GitBlit配置为Windows服务
  Gitblit uses Apache Commons Daemon to install and configure its Windows service.

  • Review the contents of the installService.cmd where you may have to change the default keystore password.
  • Set the ARCH value as appropriate for your installed Java Virtual Machine.
  • Add any necessary --StartParams as enumerated below in Command-Line Parameters.
  • Execute the script.
  After service installation you can use the gitblitw.exe utility to control and modify the runtime settings of the service.
Additional service definition options and runtime capabilities of gitblitw.exe (prunmgr.exe) are documented here.
  NOTE:
If you change the name of the service from gitblit you must also change the name of gitblitw.exe to match the new service name otherwise the connection between the service and the utility is lost, at least to double-click execution.
  =============================
Tickets
  http://gitblit.com/tickets_setup.html
  =================================
  Gitblit进行迁移的时候,需要同步用户设置,
  git.repositoriesFolder = F:/GitServer
server.httpPort = 8080
server.httpsPort = 8443
  Any important changes to the setting keys or default values will always be mentioned in the release log.
  Gitblit v0.8.0 introduced a new default user service implementation which serializes and deserializes user objects into users.conf.
  A users.conf file will be automatically created from an existing users.properties file on the first launch after an upgrade.
  To use the users.conf service,realm.userService=users.conf must be set.
  This revised user service allows for more sophisticated Gitblit user objects and will facilitate the development of more advanced features without adding the complexity of an embedded SQL database.
  users.properties and its user service implementation are deprecated as of v0.8.0.
  users.properties会在服务器启动的时候,自动转换成users.conf
  ===============================

运维网声明 1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com

所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其承担任何法律责任,如涉及侵犯版权等问题,请您及时通知我们,我们将立即处理,联系人Email:kefu@iyunv.com,QQ:1061981298 本贴地址:https://www.yunweiku.com/thread-348365-1-1.html 上篇帖子: 用scm-manager来管理服务器上的git库 下篇帖子: 类似github的框架
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

扫码加入运维网微信交流群X

扫码加入运维网微信交流群

扫描二维码加入运维网微信交流群,最新一手资源尽在官方微信交流群!快快加入我们吧...

扫描微信二维码查看详情

客服E-mail:kefu@iyunv.com 客服QQ:1061981298


QQ群⑦:运维网交流群⑦ QQ群⑧:运维网交流群⑧ k8s群:运维网kubernetes交流群


提醒:禁止发布任何违反国家法律、法规的言论与图片等内容;本站内容均来自个人观点与网络等信息,非本站认同之观点.


本站大部分资源是网友从网上搜集分享而来,其版权均归原作者及其网站所有,我们尊重他人的合法权益,如有内容侵犯您的合法权益,请及时与我们联系进行核实删除!



合作伙伴: 青云cloud

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