git://协议到底是什么? [英] What exactly is the git:// protocol?

查看:146
本文介绍了git://协议到底是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在查看ISO OSI图表,在这里您可以看到git使用的其他两种协议:

I was checking the ISO OSI chart where you can see the other two protocols git uses:

https:(这是ssl上的http)

https: ( this is http over ssl)

ssh

但没有提及 git://

这是ISO OSI:

https://en.wikipedia.org/wiki/OSI_model

推荐答案

The git protocol is a special daemon that comes packaged with Git; it listens on a dedicated port (9418) that provides a service similar to the SSH protocol, but with absolutely no authentication.

它是在Git刚开始的时候在 commit 2386d65(2005年7月,Git 0.99)中引入的. 1)

It was introduced at the very beginning of Git, in commit 2386d65 (July 2005, Git 0.99.1)

在"git protocol"连接逻辑上添加第一个剪切片段.

对于从专用服务器中提取内容很有用.而不是连接 使用ssh或仅启动本地管道,我们通过TCP连接到 另一端,尝试查看是否有git服务器在监听.

Add first cut at "git protocol" connect logic.

Useful for pulling stuff off a dedicated server. Instead of connecting with ssh or just starting a local pipeline, we connect over TCP to the other side and try to see if there's a git server listening.

当然,由于我尚未编写git服务器,因此永远不会 发生.但是服务器实际上只需要侦听端口,并且 当有人连接时执行"git-upload-pack".

Of course, since I haven't written the git server yet, that will never happen. But the server really just needs to listen on a port, and execute a "git-upload-pack" when somebody connects.

(它应读取一条数据包行,其格式应为

(It should read one packet-line, which should be of the format

"git-upload-pack directoryname\n"

,最终我们可能还有服务器可能接受的其他命令.

and eventually we might have other commands the server might accept).

该协议最初在下一个提交9b011b2

有两种Pack推挽式协议.

There are two Pack push-pull protocols.

  • upload-pack(S)|提取/克隆打包(C)协议:
  • send-pack | receive-pack协议
  • upload-pack (S) | fetch/clone-pack (C) protocol:
  • send-pack | receive-pack protocol

如今, Documentation/git-daemon.txt .

一个非常简单的TCP Git守护程序,通常在端口"DEFAULT_GIT_PORT"(也称为9418)上进行侦听. 它等待连接请求服务,如果启用该服务,则将为该服务提供服务.

A really simple TCP Git daemon that normally listens on port "DEFAULT_GIT_PORT" aka 9418.
It waits for a connection asking for a service, and will serve that service if it is enabled.

请注意,即使未在OSI模型中列出,但从头开始仍然将9418列为 IANA(互联网号码分配机构)

Note that even though is isn't listed in OSI model, 9418 is still listed from the very beginning as IANA (Internet Assigned Numbers Authority)

请参见提交ba8a497(2005年,Git 0.99.7a :

[PATCH]添加有关IANA确认的注释

git端口(9418)已由IANA正式列出.
因此,记录下来.

[PATCH] Add note about IANA confirmation

The git port (9418) is officially listed by IANA now.
So document it.

这篇关于git://协议到底是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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