1. Install the Java environment

Because before installed, not repeat. There are many tutorials on the web, you can search for them.

2. Install the Gitblit

2.1 download

Gitblit download down is a zip package, directly decompress. Here I downloaded gitblit-1.8.0.zip and unzipped it to disk D. The final path is D:\gitblit-1.8.0.

The decompression path had better not have Spaces and Chinese characters.

2.2 configuration

Properties file in the data file (D:\gitblit-1.8.0\data\gitblit.properties), open it with EditPlus or Notepad and edit it.

  1. Configure the resource library path
# This is my setup, can be set to another path
git.repositoriesFolder = E:/GitRepository
Copy the code

** Note that slashes in paths must be used with /, not \ **

  1. The IP address and port number of the HTTP service are specified
If no specific IP address is set, then all IP addresses of the host will be bound.
If set to localhost, Gitblit will only listen for requests to localhost.Server. HttpBindInterface = 192.168.199.239The recommended port number is 80 or 8080
server.httpPort = 10101
Copy the code
  1. The IP address and port number of the HTTPS service are specified
# IP, same rules as HTTP.Server. HttpsBindInterface = 192.168.199.239443 or 8443
server.httpsPort = 8443
Copy the code
  1. Save and close.

2.3 run gitblit. CMD

Located in the root directory. D:\gitblit-1.8.0\gitblit. CMD If the operation is successful, the following interface is displayed:

2.4 Verifying the installation

In front of the browser to enter configuration of the HTTP service IP and port number to access is http://192.168.199.239:10101/ (I), in the following interface was successful.

2.5 Enabling Gitblit to start in Windows Service Mode

Start gitblit by running gitblit. CMD. If you don’t want to double click it every time you start up, it will be beautiful. So let’s see how we do that.

  1. Open installService. CMD. The file is located in the root directory. My isD: \ gitblit - 1.8.0 comes with \ installService CMDOpen it with EditPlus or Notepad.
  2. Edit the installService.cmd file
SET ARCH=x86, SET ARCH=amd64
SET ARCH=amd64
Add CD to the program directoryThe SET CD = D: \ gitblit - 1.8.0 comes with# change the start parameter in StartParams to null.
 --StartParams="" ^
Copy the code
  1. save
  2. Run the installService.cmd file as an administrator.
  3. Under Machine-management-services, you can see the Existing Gitblit service.

If you have other problems during installation, please leave a message.