OscarRyz
OscarRyz

Reputation: 199294

What's wrong with using https in a Git repo?

I found this answer and it says: A common mistake is clone using https - what's wrong with that?

Upvotes: 2

Views: 156

Answers (3)

Antoine Pelisse
Antoine Pelisse

Reputation: 13129

It's not a bad idea.

You will be asked for your password when running remote commands. Also, newest version of git will be able to cache your login/password.

Finally, setting-up the key is not any easier than using netrc(5):

$ cat ~/.netrc
machine github.com
    login my_login
    password my_password

Of course, you should protect this file so that nobody can read it.

Upvotes: 1

Isaac
Isaac

Reputation: 3616

If you clone using the https address, then that will be saved as the remote location for your repository, and will be where git tries to push and pull from. What's wrong with this you might ask? Not much, except that if you don't want to log-in to github in order to push and pull, then you want to be using the ssh address so that you can authenticate with your public key.

Upvotes: 2

Paritosh Singh
Paritosh Singh

Reputation: 6404

It says that if you clone git using https, everytime you make connection to server, you need to do https authentication for which username and password are required to establish the connection.

Upvotes: 2

Related Questions