Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using ssh vs https with github submodules

I would like to set up a public GitHub repo with submodules. GitHub offers two ways of connecting - https:... & git@... protocols. For the team working on the project, git@... is much easier to use because we all use proper ssh certificates. But for the casual user who is not a member of the team, https:... is the only option. The git submodules require a full URL.

How can we set up repository submodules so that both the developers and casual contributors can use the system equally well? Thanks!

like image 287
Yuri Astrakhan Avatar asked May 10 '18 23:05

Yuri Astrakhan


People also ask

Which is better SSH or HTTPS in Git?

The default on both GitHub.com (the website) and in GitHub CLI is using the HTTPS protocol for git operations. This default was chosen for interoperability and ease of use: Git users who are behind firewalls find that traffic to port 443 (HTTPS) is more often allowed than traffic to port 22 (SSH).

Is SSH faster than HTTPS for Git?

If you have two-factor authentication enabled, you will have to use a personal access token instead of your regular password. HTTPS works practically everywhere, even in places which block SSH and plain-Git protocols. In some cases, it can even be a little faster than SSH, especially over high-latency connections.

Is there any difference between using HTTPS link and SSH link clone a repository?

The difference is in the protocol used, as you probably guessed. Assuming you don't much care about the technical details between HTTPS and ssh, ssh has the advantage that you can use public key authentication, while you must use a username and password with HTTPS.

Is HTTPS less secure than SSH?

If you steal the SSH key, you only get access to the repositories on the account whereas if you steal the HTTPS credentials, you gain access to not only the repositories but also the account settings.


1 Answers

Publish your submodules with https:// protocol but make all your developers to use ssh:// protocol. Git can substitute one protocol with the other on the fly:

git config url."ssh://git@".insteadOf https://
like image 112
phd Avatar answered Oct 08 '22 20:10

phd