【发布时间】:2015-08-04 13:46:20
【问题描述】:
Git 接受许多不同的 url 格式(例如 ssh、http、https 等)。是否有任何规范/官方文档可以找到支持的 git url 格式?
我写了一个git url parser,我想确保它所做的事情是正确的。
Here, on 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.gitssh://host.xz/~/path/to/repo.gituser@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.githost.xz:path/to/repo.gitrsync://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.gitfile:///path/to/repo.git/file://~/path/to/repo.git/
【问题讨论】: