首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >支持的git url格式是什么?

支持的git url格式是什么?
EN

Stack Overflow用户
提问于 2015-08-04 05:24:42
回答 1查看 14.4K关注 0票数 15

Git接受许多不同的url格式(例如ssh、http、https等)。是否有任何规范/官方文档可以找到受支持的git url格式?

我写了一个git url解析器,我想确定它在那里所做的是正确的。

这里,在YonderGit上,我找到了下面的列表。由于https://<token>:x-oauth-basic@host.xz/path/to/repo.git不存在,所以它还没有完成。

安全壳传输协议

  • ssh://user@host.xz:port/path/to/repo.git/
  • ssh://user@host.xz/path/to/repo.git/
  • ssh://host.xz:port/path/to/repo.git/
  • ssh://host.xz/path/to/repo.git/
  • ssh://user@host.xz/path/to/repo.git/
  • ssh://host.xz/path/to/repo.git/
  • ssh://user@host.xz/~user/path/to/repo.git/
  • ssh://host.xz/~user/path/to/repo.git/
  • ssh://user@host.xz/~/path/to/repo.git
  • ssh://host.xz/~/path/to/repo.git
  • user@host.xz:/path/to/repo.git/
  • host.xz:/path/to/repo.git/
  • user@host.xz:~user/path/to/repo.git/
  • host.xz:~user/path/to/repo.git/
  • user@host.xz:path/to/repo.git
  • host.xz:path/to/repo.git
  • rsync://host.xz/path/to/repo.git/

Git传输协议

  • git://host.xz/path/to/repo.git/
  • git://host.xz/~user/path/to/repo.git/

HTTP/S传输协议

  • http://host.xz/path/to/repo.git/
  • https://host.xz/path/to/repo.git/

本地(文件系统)传输协议

  • /path/to/repo.git/
  • path/to/repo.git/
  • ~/path/to/repo.git
  • file:///path/to/repo.git/
  • file://~/path/to/repo.git/
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2015-08-04 05:46:20

您可以看到git准备在urlmatch.hurlmatch.c中解析什么。

这是t0110-urlmatch-normalization.sh使用的,它说明了git测试的可能的url的完整列表。

url.c的确提到:

根据STD66 (RFC3986),一组有效的URL方案是“[A-Za-z][A-Za-z0-9+.-]*”。 但是要使用更宽松的“[A-Za-z0-9][A-Za-z0-9+.-]*”检查,因为早期版本的check使用了“[A-Za-z0-9]+”,这样就不会破坏任何远程帮助程序。

票数 8
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/31801271

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档