Git Detailed Agreement / speed / safety

Protocol Overview

  Git shared services implementation is broadly divided into four categories: file sharing type, git type, ssh type, http type;

 

Local agreements

  Local protocol: file sharing type , it is a Git project, through file-sharing manner; such as NFS , the FTP , Samba , San , ISCSI , etc. for Git project sharing; for example, this: git clone /opt/git/project.git , and or is this: git clone File : ///opt/git/project.git . If the URL used at the beginning of the File : // , then git will run in a slightly different way. If you just specify the path, Git tries to use a hard link or directly copy the files it needs. If the  File: //  , the Git will call its usual step to transmit data through the network, while the efficiency is relatively low in this way. Use  file: //  main reason prefix is if you need a clean and does not contain a copy of the repository with extraneous references or objects of the time -Generally refers to importing from another control system, or similar situations.

Advantages: simple and crude, keep the original file permissions 
Disadvantages: difficult to control access from different locations, and the speed is limited by sharing agreement

 

SSH protocol

ssh protocol: Git project sharing protocol used in the most common estimate is that SSH up. This is because most already set up SSH access to the server, even if not , set up is also very easy. SSH is also the only network protocol supports read and write operations. The other two network protocols ( HTTP and Git ) are generally read-only, although both are available for most people, but still need to write the implementation of SSH . SSH is also an authenticated network protocol; and because of its universality, the general set up and very easy to use. By SSH clone a Git repository, so you can be given as follows SSH : // in the URL of : git clone SSH : //user@server/project.git or git clone the User @ Server : project.git . If the user is not named, Git will default to the current user connection; if you do not name the agreement,Git will default to the ssh protocol for transmission.

Advantages: read and write at the same time, relatively simple to set up, easy maintenance, transport safe and efficient transfer speeds 
Cons: not anonymous access

 

GIT agreement

  Git protocol: This is contained in a Git special daemon software package; it listens on a similar SSH particular port (Service 9418 ), without any authorization. We intend to support Git protocol warehouse, create  git-daemon-export-ok  file - it is a necessary condition for the agreement process to provide warehouse services - but other than that there is no security. Either everyone cloning Git repository, or who can not. This also means that the agreement is generally no pushing. You can enable push access; but given the lack of authentication, if the operation is allowed, any item on the network know a URL of people will have push access. Needless to say, this is a very rare case.

Pros: fast transmission speed, even more accelerated than SSH, anonymously 
drawback: the lack of authentication, unsafe

 

 

HTTP / HTTPS protocol

  HTTP / HTTPS protocols: HTTP or HTTPS beauty of the agreement is that the ease of erection. Basically, just need to Git bare repository files in HTTP root directory, set up a specific  post-update  hook ( Hook ) can handle ( Git hooks details see Section 7 chapter). Since then, each able to access Git on the server where warehouse web services can also clone.

Benefits: The benefits of using the HTTP protocol is easy to set up. A few necessary commands you can let the world read the contents of the warehouse. But take a few minutes. HTTP protocol does not take up too much server resources. Because it generally uses a static HTTP server to serve all the data, the average per ordinary Apache server can support thousands of concurrent access to files - even a small server let's difficult to overload. 
Disadvantages: the negative side is that the HTTP protocol, the client relatively lower efficiency. Clone or fetch from the repository may take more time, and HTTP transport volume and network overhead is greater than any other protocol. Because it does not have the ability to supply the demand - the transmission process is not dynamic computing services end - the HTTP protocol is often referred to as the fool (dumb) protocol. More on the difference between the HTTP protocol and other protocols efficiency

Reference Address: http://blog.csdn.net/liangpz521/article/details/21534849

 

Compare the speed of

Fastest Git , followed by SSH , followed by local agreement, and finally the http protocol

 

Relatively safe

The safest is SSH , followed by the http protocol, then the local protocol, and finally git

 

 

, Or is this: git clone File : ///opt/git/project.git . If the URL used at the beginning of the File : // , then git will run in a slightly different way. If you just specify the path, Git tries to use a hard link or directly copy the files it needs. If the  File: //  , the Git will call its usual step to transmit data through the network, while the efficiency is relatively low in this way. Use  file: //  main reason prefix is when you need a clean and does not contain a copy of the repository with extraneous references or objects - generally refers imported from other version control system, or similar situations.

 

Guess you like

Origin www.cnblogs.com/guge-94/p/11267256.html