Reputation: 45380
Is there a performance difference between using the SSH protocol (ssh://)
or the Git (git://)
protocol for pushing?
If I want to use Git, don't I have to setup the git server dameon and open that port in iptables? Seems like a lot of extra work, and also additional memory usage for the dameon, when SSH is already setup and working.
There must be a benefit to using the native git:// protocol because GitHub uses it, instead of ssh://.
Upvotes: 4
Views: 2040
Reputation: 301367
First of all, GitHub uses ssh as the main protocol and the read-only access is given through the git protocol.
git:// will be the fastest way for cloning a project since it does not have the overhead of encryption and authentication. But otherwise, both ssh:// and git:// have the same git specific optimizations for transport. That is why many projects, including for those on GitHub, have git:// for read-only access and ssh for pushing to.
So to answer your question, ssh:// is best for pushing, because git:// is NOT used for pushing.
Upvotes: 7
Reputation: 10579
Is there a performance difference between using the SSH protocol (ssh://) or the Git (git://) protocol for pushing?
There is ssh's encryption of course.
If I want to use Git, don't I have to setup the git server dameon and open that port in iptables?
Depends on the protocol you choose. Since you usually want pushs to be authenticated (and the authentication be encrypted), ssh's facilities are commonly used -- since in essence, you will be running git-native protocol, but over an ssh tunnel. (Impl detail: Both git-daemon and git-push through ssh spawn the git-receive-pack subutility.)
git-daemon service is usually provided for read-only anonymous access, because neither auth nor encryption is required/desired here.
Upvotes: 0