Quais são os formatos de url git suportados?
O Git aceita vários formatos de url diferentes (por exemplo, ssh, http, https, etc.). Existem algumas especificações/documentos oficiais onde posso encontrar os formatos de url git suportados?
escrevi um analisador de url git e quero ter a certeza de que o que foi feito lá está correcto.
Protocolo De Transporte Seguro Da Shell
ssh://[email protected]:port/path/to/repo.git/
ssh://[email protected]/path/to/repo.git/
ssh://host.xz:port/path/to/repo.git/
ssh://host.xz/path/to/repo.git/
ssh://[email protected]/path/to/repo.git/
ssh://host.xz/path/to/repo.git/
ssh://[email protected]/~user/path/to/repo.git/
ssh://host.xz/~user/path/to/repo.git/
ssh://[email protected]/~/path/to/repo.git
ssh://host.xz/~/path/to/repo.git
[email protected]:/path/to/repo.git/
host.xz:/path/to/repo.git/
[email protected]:~user/path/to/repo.git/
host.xz:~user/path/to/repo.git/
[email protected]:path/to/repo.git
host.xz:path/to/repo.git
rsync://host.xz/path/to/repo.git/
Protocolo De Transporte Git
git://host.xz/path/to/repo.git/
git://host.xz/~user/path/to/repo.git/
HTTP/S Transport Protocol
http://host.xz/path/to/repo.git/
https://host.xz/path/to/repo.git/
Protocolo De Transporte Local (Sistema De Ficheiros)
/path/to/repo.git/
path/to/repo.git/
~/path/to/repo.git
file:///path/to/repo.git/
file://~/path/to/repo.git/
1 answers
Você pode ver o que git está preparado para analisar em urlmatch.h
e urlmatch.c
.
Que é usado por t0110-urlmatch-normalization.sh
, o que ilustra a lista completa de possíveis url testados pelo git.
url.c
menciona:
O conjunto de esquemas URL válidos, de acordo com o STD66 (RFC3986), é '
[A-Za-z][A-Za-z0-9+.-]*
'.
Mas use uma verificação mais flexível de '[A-Za-z0-9][A-Za-z0-9+.-]*
'porque a versão anterior da verificação usou'[A-Za-z0-9]+
' para não quebrar nenhum servidor remoto.