Windows环境下用Gitblit搭建git服务器
一,下载Gitblit。下载地址:http://gitblit/
现在版本是1.8.0。
二,下载后解压该文件,找到data/目录下的defaults.properties文件,这个配置文件是启动git服务器的关键配置文件。有几处关键地方需要定制化修改。
(1)服务器地址和端口:
server.httpBindInterface =
server.httpsBindInterface =
server.httpPort =
server.httpsPort = 8443
如果是本地搭建,可以把本地服务器地址设为localhost,端口变为8080,这样就变成:
server.httpBindInterface = localhost
server.httpsBindInterface = localhost
server.httpPort = 8080
server.httpsPort = 8443
(2)git项目代码仓库配置。
git.repositoriesFolder =
可以设为自己定义的Windows专用目录文件放自己的代码,如D盘下的git\project目录文件:
git.repositoriesFolder = D:\\git\\project
三,启动gitblit服务器。
完成以上配置后,直接通过Windows命令行启动gitblit.cmd文件即可,如:
或者直接输入gitblit(省略.cmd),然后回车执行。
四,以上都完成后,就可以直接在浏览器输入 http://localhost:8080 进入git服务器,默认用户名和密码均是admin。如需修改,需要配置 users.conf 里面用户配置信息。