GIT-windows系统部署gitblit服务器

GIT-windows系统部署gitblit服务器,第1张

GIT-windows系统部署gitblit服务器 windows系统部署 gitblit 服务器 1. 安装JAVA环境

下载Java,下载地址:http://www.java.com/zh_CN/

  安装Java.安装步骤不再详述。


     配置Java环境变量.

右键”计算机” => ”属性” => ”高级系统设置” => ”高级” => “环境变量” => “系统变量”。


  1. 新建:

    变量名:JAVA_HOME

    变量值:D:\Program Files (x86)\Java\jdk1.6.0_21【具体要根据你自己的安装路径,我的是安装在D盘的】

2.  新建:

    变量名:CLASSPATH

    变量值:.;%JAVA_HOME%/lib/dt.jar;%JAVA_HOME%/lib/tools.jar

3. 添加:找到PATH变量,选择编辑。


把%JAVA_HOME%/bin;%JAVA_HOME%/jre/bin添加到”变量值”的结尾处。


验证Java是否安装成功。


打开命令窗口=> 输入CMD => 确定。


在命令窗口中,输入java命令:javac,回车,如果出现如下信息,说明安装成功。


2. 安装GitLib

下载Gitblit.下载地址:http://www.gitblit.com/

解压缩下载的压缩包即可,无需安装。


3. 创建用于存储资料的文件夹。


4. 配置gitblit.properties 文件。


  1. 找到Git目录下的data文件下的gitblit.properties文件,“记事本”打开


  2. 找到git.repositoriesFolder(资料库路径),创建好的文件目录。


    (填写路径时注意 / 方向。


    如填写为 \ 则报“Internal error” 错误。


  3. 找到server.httpPort,设定http协议的端口号
  4. 找到server.httpBindInterface,设定服务器的IP地址。


    这里就设定你的服务器IP。


  5. 找到server.httpsBindInterface,设定为localhost

  6. 保存,关闭文件。


#
# GITBLIT.PROPERTIES
#
# Define your custom settings in this file and/or include settings defined in
# other properties files.
# # Include Gitblit's 'defaults.properties' within your configuration.
#
# NOTE: Gitblit will not automatically reload "included" properties. Gitblit
# only watches the 'gitblit.properties' file for modifications.
#
# Paths may be relative to the ${baseFolder} or they may be absolute.
#
# COMMA-DELIMITED
# SINCE 1.7.0
include = defaults.properties #
# Define your overrides or custom settings below
# server.httpPort=10101
server.httpsPort=8443 server.httpBindInterface=10.7.34.242
server.httpsBindInterface=localhost git.repositoriesFolder=E:/toos2/git/gitRepository
5. 运行gitblit.cmd 批处理文件。


1. 找到bitblit目录中的gitblit.cmd文件,双击。


2. 运行结果如下,运行成功。


6. 打开网站

在浏览器中打开,现在就可以使用GitBlit了,默认用户名密码都是:admin。


在本地可打开网址:10.7.34.242:10101(本地地址+10101端口)

7. 设置以Windows Service方式启动Gitblit.

1. 在Gitblit目录下,找到installService.cmd文件。


2. 用“记事本”打开。


3. 修改 ARCH

    32位系统:SET ARCH=x86

    64位系统:SET ARCH=amd64

  4. 添加 CD 为程序目录

    SET CD=D:\Git\Gitblit-1.6.0(你的实际目录)

5. 修改StartParams里的启动参数,给空就可以了。


@REM Install Gitblit as a Windows service.

@REM gitblitw.exe (prunmgr.exe) is a GUI application for monitoring
@REM and configuring the Gitblit procrun service.
@REM
@REM By default this tool launches the service properties dialog
@REM but it also has some other very useful functionality.
@REM
@REM http://commons.apache.org/daemon/procrun.html @REM arch = x86, amd64, or ia32
SET ARCH=amd64 SET CD=E:\toos2\git\gitblit-1.8.0 @REM Be careful not to introduce trailing whitespace after the ^ characters.
@REM Use ; or # to separate values in the --StartParams parameter.
"%CD%\%ARCH%\gitblit.exe" //IS//gitblit ^
--DisplayName="gitblit" ^
--Description="a pure Java Git solution" ^
--Startup=auto ^
--LogPath="%CD%\logs" ^
--LogLevel=INFO ^
--LogPrefix=gitblit ^
--StdOutput=auto ^
--StdError=auto ^
--StartPath="%CD%" ^
--StartClass=org.moxie.MxLauncher ^
--StartMethod=main ^
--StartParams="" ^
--StartMode=jvm ^
--StopPath="%CD%" ^
--StopClass=org.moxie.MxLauncher ^
--StopMethod=main ^
--StopParams="--stop;--baseFolder;%CD%\data" ^
--StopMode=jvm ^
--Classpath="%CD%\gitblit.jar" ^
--Jvm=auto ^
--JvmMx=1024

  6. 保存,关闭文件。


8. 以Windows Service方式启动Gitblit.

1. 双击Gitblit目录下的installService.cmd文件(以管理员身份运行)。


2. 在服务器的服务管理下,就能看到已经存在的gitblit服务了。


    3. 启动此服务。


   平时使用时,保持这个服务是启动状态就可以了。


以上就是Windows平台下,配置Git服务器的全部的全部内容。


引用:https://www.cnblogs.com/ucos/p/3924720.html

欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/zaji/587896.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-04-12
下一篇 2022-04-12

发表评论

登录后才能评论

评论列表(0条)

保存