Get ready
CentOS Linux release 7.0.1406 (Core)
SSH 22 Port
HTTP 80 Port
This article is mainly SSH protocol support, HTTP protocol configuration after the problem.
Excerpt of a paragraph of explanation
SSH protocol
Setting up a Git server often uses the SSH protocol as the transport Protocol. Because SSH access is already supported in most environments-it's not easy to set up on the fly. SSH protocol is also a authentication authorization network protocol, and because of its universality, erection and use are easy.
To clone the repository via the SSH protocol, you can specify a ssh://URL:
clone ssh://[email protected]/project.git
Or use a short, SCP-style notation:
$ git clone user@server:project.git
You can also not specify the user, Git will use the currently logged in user name.
Advantage
There are many advantages to using the SSH protocol. First, SSH is relatively simple--ssh daemon is common, most administrators have experience, and most operating systems contain it and related management tools. Second, access via SSH is secure-all transmitted data is authorized and encrypted. Finally, like the HTTP/S protocol, the Git protocol, and the local protocol, the SSH protocol is efficient and compresses the data as much as possible before it is transmitted.
Disadvantages
The disadvantage of the SSH protocol is that you cannot achieve anonymous access through him. Even if you read the data, the user has access to your host via SSH, which makes the SSH protocol detrimental to open source projects. If you only use the company network, the SSH protocol may be the only protocol you need to use. If you want to provide both anonymous read-only access and SSH protocol, you have to set up a service that allows others to access it, in addition to setting up an SSH service for yourself.
2016-10-26 Add, SSH does not have HTTP access convenience, has been replaced by Gitlab implementation, but also good, reference official website documents can
Build a git server under CentOS