Skip to content

Commit a7ce965

Browse files
committed
add post
1 parent 7cf82d2 commit a7ce965

File tree

1 file changed

+74
-0
lines changed

1 file changed

+74
-0
lines changed
Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
title: '快速搭建 Git 服务器[Windows版]'
2+
author: 少年闰土
3+
tags:
4+
- Git
5+
categories:
6+
- Dev
7+
date: 2020-03-25 13:57:00
8+
---
9+
## 服务器搭建
10+
### 下载
11+
* 下载 JDK:[https://www.oracle.com/technetwork/java/javase/downloads/](https://www.oracle.com/technetwork/java/javase/downloads/)
12+
* 下载 Gitblit:[http://gitblit.com/](http://gitblit.com/)
13+
![gitblit.png](http://q6rnahf7l.bkt.clouddn.com/gitblit-download.png)
14+
15+
### 解压
16+
解压缩下载的压缩包即可,无需安装。
17+
![图片.png](http://q6rnahf7l.bkt.clouddn.com/gitblit-unzip.png)
18+
19+
### 创建本地存储文件夹
20+
![图片.png](https://upload-images.jianshu.io/upload_images/12553249-a76cb14fde58df1d.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
21+
22+
### 配置
23+
打开data文件夹下的`gitblit.properties`
24+
在第17行可以看到
25+
```
26+
include = defaults.properties
27+
```
28+
同文件夹下找到`defaults.properties`
29+
将上边配置的本地存储文件夹的路径复制过来
30+
```
31+
#git.repositoriesFolder = ${baseFolder}/git
32+
git.repositoriesFolder = E:\GitBlit\Repository
33+
```
34+
找到server.httpPort,设定http协议的端口号
35+
```
36+
# Standard http port to serve. <= 0 disables this connector.
37+
# On Unix/Linux systems, ports < 1024 require root permissions.
38+
# Recommended value: 80 or 8080
39+
#
40+
# SINCE 0.5.0
41+
# RESTART REQUIRED
42+
server.httpPort = 1024
43+
```
44+
找到server.httpBindInterface,设定服务器的IP地址。这里就设定你的服务器IP。
45+
```
46+
# Specify the interface for Jetty to bind the standard connector.
47+
# You may specify an ip or an empty value to bind to all interfaces.
48+
# Specifying localhost will result in Gitblit ONLY listening to requests to
49+
# localhost.
50+
#
51+
# SINCE 0.5.0
52+
# RESTART REQUIRED
53+
server.httpBindInterface = localhost
54+
```
55+
56+
找到server.httpsBindInterface,设定为localhost
57+
```
58+
# Specify the interface for Jetty to bind the secure connector.
59+
# You may specify an ip or an empty value to bind to all interfaces.
60+
# Specifying localhost will result in Gitblit ONLY listening to requests to
61+
# localhost.
62+
#
63+
# SINCE 0.5.0
64+
# RESTART REQUIRED
65+
server.httpsBindInterface = localhost
66+
```
67+
68+
### 运行
69+
运行gitblit.cmd
70+
![图片.png](https://upload-images.jianshu.io/upload_images/12553249-6b503e5eb808e0e6.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
71+
如上图则运行成功
72+
在浏览器中打开,现在就可以使用GitBlit了。默认用户名密码都是 admin
73+
![图片.png](https://upload-images.jianshu.io/upload_images/12553249-fafa7b54defcb599.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
74+

0 commit comments

Comments
 (0)