5

I'm writing a program that can take a Git clone URI and make a clone of the repository on the user's machine. To do this, the program needs to know when it can go ahead with the cloning, and when it needs to give up. The man page for git-clone says that:

Git supports ssh, git, http, and https protocols (in addition, ftp, and ftps can be used for fetching and rsync can be used for fetching and pushing, but these are inefficient and deprecated; do not use them).

How much of this is supported by libgit2?

I know that at the very least they support HTTP, HTTPS and SSH but what about the others?

2
  • I would guess that libgit2 doesn't support more than Git itself, and since it supports HTTP(S) and SSH, what more are you looking for? Commented Dec 6, 2015 at 0:26
  • @Whymarrh Just curious. If libgit2 actually does support deprecated protocols like FTP then I don't want the program to lie and tell the user it can't clone their repository. Commented Dec 6, 2015 at 0:34

1 Answer 1

5

tl;dr: local, git, ssh, http, https. It does not and has never supported ftp, ftps or rsync.


NOTE: This is all as of v0.23.4.

The list of transport mechanisms libgit2 supports can be found in their "transport" section. These are high level transport algorithms. The particular network protocols are sub-transports.

  • dummy
  • local
  • smart
  • ssh-with-paths

Of those, we only care about local and smart (see transport.c). local is for local files like file:///home/foo/some_project. ssh-with-paths is a wrapper around smart-ssh that lets you explicitly state which programs on the remote to use that you'll probably never use. Anything over the network uses smart.

The "smart" protocol is one which expects the remote to be more than just a file server. Instead of having to do all the work to determine what objects are needed by requesting files and figuring it all out locally, it can call certain programs on the remote to do that work more efficiently. Here's a discussion of the smart vs dumb protocols.

Which smart network protocols libgit2 supports is in their "smart" section.

  • ssh
  • http
  • https
  • git

You can see this in more detail in transport.c.

As for the deprecated protocols ftp, ftps and rsync, libgit2 does not support them and you can see from their change log they never supported them. Also I don't know if libgit2 will support the dumb protocol.

Sign up to request clarification or add additional context in comments.

1 Comment

ssh-with-paths isn't a protocol, that's the name of the constructor for the ssh transport where you specify the executable paths instead of using the default.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.