omar
omar

Reputation: 1611

What is the best way to use Git, with HTTPS or with SSH?

What is the safest way to use services like Github and Bitbucket? What are the differences between using HTTPS versus SSH?

Is there a difference in the form of the git clone command? For example,

git clone [email protected]:nsf/godit.git

versus:

git clone https://github.com/nsf/godit.git

I'd like avoid problems such as the one described here: Troubleshooting git push - it asks for a user/pass

Upvotes: 3

Views: 9314

Answers (1)

Alex Yarmula
Alex Yarmula

Reputation: 10677

The differences are mainly in the way authentication is done: for SSH, you'll use the keys to authenticate, and HTTPS will use username/password.

Note that to use SSH, you'll need to have write access to a repository, whereas HTTPS can be used for any type of a repository. Here's a useful help page with more details.

To avoid having to re-enter the password with HTTPS authentication, see this article.

Upvotes: 4

Related Questions