哪个是更智能的 git 协议,ssh 或 git(通过 ssh)或 https 协议? [英] Which is the smarter git protocol, ssh or git(over ssh) or https protocol?

查看:36
本文介绍了哪个是更智能的 git 协议,ssh 或 git(通过 ssh)或 https 协议?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

哪个有效?SSH://或 Git://(文件压缩)

Which is efficient? SSH:// or Git:// (File compression)

我在 Git 中理解,git 协议很聪明,因为在通信的两端都有一个协议代理来压缩文件传输,从而通过有效地使用网络带宽来更快地克隆.

I understand in Git, git protocol is smart because there is a protocol agent on both ends of communication to compress the file transfer resulting in faster clone by efficiently using the network bandwidth.

一本 O'Reilly 的书我发现以下陈述.

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*

我不确定作者是否是他所说的意思.他谈到了通过 SSH 建立隧道的 git 协议.

I'm not sure if the author means what he says. He talks of git protocol getting tunneled over SSH.

在我看来,除非你连接到git端口(代理端口),否则协议是无效的.SSH 只是一种未压缩的文件传输.但是按照作者的说法,如果我们使用 SSH,他说 git 协议是通过它隧道传输的.那么 SSH 在 GIT 中是否更智能?

From my perspective, unless you connect to the git port (agent port), the protocol is not in effect. And SSH is merely an 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?

冯C,感谢您的回答.网络协议(HTTP 和 Git)通常是只读的"当您使用 --enable=receive-pack 运行守护程序时,Git 可以成为 rw.

Von C, Thanks for your answer. "Network protocols (HTTP and Git) are generally read-only" Git can be made rw when you run the daemon with --enable=receive-pack.

以下是我的顾虑.
当他们说 git 协议是智能的时,他们的意思是当您执行 git clone 时,Git 服务器代理会压缩发送回客户端的数据,因此克隆应该更快.在我的用例中,我将在香港设置 Git 服务器并在圣何塞和其他国家/地区使用它,因此由于延迟问题,我希望通过网络提高效率.

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. In my use case I'll be setting the Git server in Hongkong and using it on San Jose and other countries as well, So I want to be efficient over network due to latency concerns.

所以我的问题是,当我使用 git clone ssh://user@server/reposloc 时,我是否也获得了 git 协议的好处?根据 O'Reilly 作者的书,他的意思是 git 通过 ssh 建立隧道,那么当我没有在服务器上运行 git 守护进程时,git 协议如何工作.

So my question is when I use git clone ssh://user@server/reposloc do I get the benefits of git protocol also? As per O'Reilly author book he means git is tunneled over ssh, then how does git protocol work when I don't have git daemon running on the server.

所以使用 SSh://xyz...它是否同时提供了 ssh 和 git 协议的好处?

So using SSh://xyz... does it give both the benefit of ssh and git protocols?

提前感谢您的回答.

推荐答案

看第二部分 本页

唯一的哑巴"协议是直接的 HTTP,它不需要在服务器上做特别的努力.在 git://和 ssh://协议中,git upload-pack 进程(不是守护进程)在与运行 git 的客户端通信的服务器上分叉取包.在 ssh://和 git://中,您可以获得智能"通信.

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.

这篇关于哪个是更智能的 git 协议,ssh 或 git(通过 ssh)或 https 协议?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆