Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can I create a custom protocol for git?

Tags:

git

p2p

I'm trying to create Git over P2P. (It's crazy, I know.)

The question is simple: can I create a custom protocol for Git alternative to ssh://, git:// and http://?

like image 748
gioi Avatar asked Jul 26 '13 08:07

gioi


People also ask

Which protocol is used by git?

Git can use four distinct protocols to transfer data: Local, HTTP, Secure Shell (SSH) and Git.

Does git use TCP?

The native git transport uses TCP port 9418. However, git can also run over ssh (often used for pushing), http, https, and less often others.


1 Answers

Yes, that is definitely possible. Git does support remote helpers for just that. From the git fetch manpage:

When git doesn’t know how to handle a certain transport protocol, it attempts to use the remote- remote helper, if one exists. To explicitly request a remote helper, the following syntax may be used:

<transport>::<address>

Further information about remote helpers can be found at the appropriate man page. If that capability is not powerful enough for you (a quick scan suggests it should be), you should remember that git is open source ;).

like image 134
Chronial Avatar answered Sep 30 '22 03:09

Chronial