1.安装配置好java环境
2.下载Git服务器软件Gitblit
下载网址:Gitblithttp://www.gitblit.com/
3.Gitblit配置项目修改
在Gitblit的安装目录下的data目录下,找到文件default.properties,server.httpPort,设置服务端口号:
server.httpBindInterface,设置Gitblit的http普通连接的服务器地址为localhost
查找server.httpsBindInterface,设置Gitblit的http安全连接的服务器地址为localhost
4、启动Gitblit
返回Gitblit安装路径,双击启动gitblit.cmd,不要关闭新弹出的cmd窗口
打开浏览器,输入以下网址:http://localhost:65530/,显示如下页面则Gitblit安装成功
5、将Gitblit设置为windows服务
记事本打开Gitblit下的installService.cmd,检查:
SET ARCH=amd64,这里如果服务器是32位系统,amd64修改为x86,是64位系统,不要修改
添加:
SET gbhome=D:DevelopGitblit,将这一行代码添加到SET ARCH下方,注意路径修改为自己的Gitblit的安装路径
修改:
--StartParams="" ^,清空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 @SETLOCAL @REM arch = x86, amd64, or ia32 SET ARCH=amd64 SET gbhome=E:gitservicegitblit-1.9.2 @SET gbhome=%gbhome:~0,-1% @REM Be careful not to introduce trailing whitespace after the ^ characters. @REM Use ; or # to separate values in the --StartParams parameter. "%gbhome%%ARCH%gitblit.exe" //IS//gitblit ^ --DisplayName="gitblit" ^ --Description="a pure Java Git solution" ^ --Startup=auto ^ --LogPath="%gbhome%logs" ^ --LogLevel=INFO ^ --LogPrefix=gitblit ^ --StdOutput=auto ^ --StdError=auto ^ --StartPath="%gbhome%" ^ --StartClass=com.gitblit.GitBlitServer ^ --StartMethod=main ^ --StartParams="--storePassword;gitblit;--baseFolder;%gbhome%data" ^ --StartMode=jvm ^ --StopPath="%gbhome%" ^ --StopClass=com.gitblit.GitBlitServer ^ --StopMethod=main ^ --StopParams="--stop;--baseFolder;%gbhome%data" ^ --StopMode=jvm ^ --Classpath="%gbhome%gitblit.jar;%gbhome%ext*" ^ --Jvm=auto ^ --JvmMx=1024 @ENDLOCAL
修改完毕保存后管理员身份运行启动,在服务中可以看到gitblit服务已存在



