Git does not have a client server concept, but to share a git repository, it is necessary to use the SSH protocol (FTP, HTTPS, SFTP and other protocols can also be used for git sharing, this document is not discussed), but SSH has a client server side, So under Windows development to share your git repository, you have to do the SSH server
Git services are now unique and more flexible than with SVN, the most popular open source project hosting site GitHub above, if hosted open source projects, then is free to use, but closed-source projects will charge a high fee, if you are not short of rice, then not in the scope of this article, since this, We can build our own git server on our own.
The majority of users in the country use the Windows Server platform, so this article discusses how to build a git server under the Windows platform.
Git server setup under Windows platform
First step: download java,:http://www.java.com/zh_cn/
Step Two: install Java. The installation steps are no longer detailed.
Step Three: Configure the Java environment variables.
Right-click "Computer" + "Properties" + "Advanced system Settings" + "advanced" + "environment variables" = "System Variables".
- New:
Variable name: java_home
Variable Value: D:\Program Files (x86) \java\jdk1.6.0_21 "specifically according to your own installation path, my is installed on the D-drive"
2. NEW:
Variable name: CLASSPATH
Variable Value:%java_home%/lib/dt.jar;%java_home%/lib/tools.jar
3. Add: Locate the path variable and select Edit. Add the%java_home%/bin;%java_home%/jre/bin to the end of the variable value.
Fourth Step: Verify that Java is installed successfully.
Open the Command window and enter cmd = = OK.
In the Command window, enter the Java command: Javac, enter, if the following information appears, the installation is successful.
Fifth step: download gitblit.:http://www.gitblit.com/
Sixth step: unzip the downloaded compressed package, without installation.
Seventh Step: Create a folder to store your data.
Eighth Step: Configure the Gitblit.properties file.
- Locate the Gitblit.properties file under the data file in the Git directory, and Notepad opens.
2. Locate the Git.repositoriesfolder (database path) and assign the seventh step to create a good file directory.
3. Locate the Server.httpport, set the port number of the HTTP protocol
4. Locate the Server.httpbindinterface and set the IP address of the server. Set up your server IP here.
5. Locate server.httpsbindinterface, set as localhost
6. Save and close the file.
nineth Step: Run the gitblit.cmd batch file.
- Locate the Gitblit.cmd file in the Bitblit directory, and double-click it.
2. The running result is as follows, the operation is successful.
Tenth step: Open in the browser, you can now use Gitblit.
11th Step: Set the Windows Service mode to start Gitblit.
- Under the Gitblit directory, locate the Installservice.cmd file.
2. Open with Notepad.
3. Modify ARCH
32-bit system: SET arch=x86
64-bit system: SET ARCH=AMD64
4. Add CD to program directory
SET cd=d:\git\gitblit-1.6.0 (your actual directory)
5. Modify the startup parameters in the Startparams, and empty it.
6. Save and close the file.
12th step: start Gitblit in Windows service mode.
1. Double-click the Installservice.cmd file (run as Administrator) in the Gitblit directory.
2. Under the service management of the server, you can see the existing Gitblit service.
3. When used normally, it is possible to keep the service up and running.
The above is the entire contents of the GIT server configured under the Windows platform.
A graphics tutorial (forwarding) for a git server built under the Windows platform