问题描述
哪个有效? SSH://或Git://(文件压缩)
我在Git中理解,git协议很智能,因为在通信的两端都有一个协议代理来压缩通过有效地使用网络带宽,文件传输可以更快地克隆。
从O'Reilly的书中,我找到了以下语句。
对于安全的身份验证连接,可以使用
以下URL模板通过SSH连接对Git本地
协议进行隧道传输:
ssh:///[user@]example.com[:port]/path/to/repo.git
ssh://[user@]example.com/path/to/repo。 git
ssh://[user@]example.com/~user2/path/to/repo.git
ssh://[user@]example.com/~/path/to/repo .git *
我不确定作者是否意味着他所说的。他谈到了通过SSH隧道传输的git协议。
从我的角度来看,除非您连接到git端口(代理端口),否则协议不起作用。而SSH仅仅是未压缩的文件传输。
但是按照作者的说法,如果我们使用SSH,他说git协议是通过它传输的。那么SSH在GIT中更聪明?
Von C,
感谢您的回答。 网络协议(HTTP和Git)通常是只读的当您使用--enable = receive-pack运行deamon时,可以将Git制作为rw。
以下是我的担忧。
当他们说git协议很聪明时,它们意味着当你执行git clone时,git server agent会压缩发送回客户端的数据,所以克隆应该更快。我的用例是,我将在香港设置git服务器,并在sanjose和其他国家使用它,所以我想通过网络提高效率,因为延迟问题。
所以我的问题是当我使用git clone ssh:// user @ server / reposloc我也得到了git协议的好处。根据Orelly作者的书,他的意思是git通过ssh传输,那么当我没有在服务器上运行git daeomon时,git协议如何工作。
所以使用SSh:/ / xyz ...它是否同时提供了ssh和git协议的好处?预先感谢您的回答。
查看
唯一的哑协议是直接的HTTP,它不需要特别的服务器。在git://和ssh://协议中,与客户端通信的服务器上分支有一个 git upload-pack
进程(它不是守护进程)谁运行 git fetch-pack
。在ssh://和git://中,您都可以进行智能沟通。
Which is effecient? SSH:// or Git:// (File compression)
I understand in Git , git protocol is smart because there is a protocol agent on both end of commumnication to compress the file transfer resulting in faster clone by effeciently using the network bandwidth.
From an O'Reilly book I found the following statements.
For secure, authenticated connections, the Git native
protocol can be tunneled over an SSH connection using
the following URL templates:
ssh: ///[user@]example.com[:port]/path/to/repo.git
ssh: //[user@]example.com/path/to/repo.git
ssh: //[user@]example.com/~user2/path/to/repo.git
ssh: //[user@]example.com/~/path/to/repo.git*
I'm not sure if the author means what he says. He talks of git protocol getting tunneled over SSH.
From my perspective, unless you connect to the git port (agent port), the protocol is not in effect. And SSH is mere uncompressed file transfer.
But as per the author, if we use SSH he says the git protocol is tunneled over it. So is SSH smarter in GIT?
Von C,Thanks for your answer. "Network protocols (HTTP and Git) are generally read-only" Git can be made rw when you run the deamon with --enable=receive-pack.
Following are my concerns.When they say git protocol is smart, they mean when you execute git clone , git server agent compresses the data that is sent back to the client , so the clone should be faster. Im my usecase i will be setting the git server in hongkong and using it on sanjose and other countries as well , So i want to be efficient over network due to latency concerns.
So my question is when i use git clone ssh://user@server/reposloc do i get the benefits of git protocol also . As per Orelly author book he means git is tunneled over ssh, then how does git protocol work when i dont have git daeomon running on the server.
So using SSh://xyz... does it give both the benefit of ssh and git protocols ?
appreciate your answers in advance.
Take a look at the second part of this page
The only "dumb" protocol is straight HTTP, which requires no special effort on the server. In both the git:// and ssh:// protocols, a git upload-pack
process (which is not a daemon) is forked on the server that communicates with the client who's running git fetch-pack
. In both ssh:// and git://, you get "smart" communication.
这篇关于哪个更快,ssh或git协议?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!