Aside: Github’s Asking for my Password

“Why is Github asking me to input my username and password when I try to push changes to a repository I own?” I asked this myself a couple of times before I figured out I had cloned it the wrong way:

git clone .

As opposed to:

git clone .

Where the former will use the HTTP protocol, and thus require basic authentication (username and password), and the latter will use the SSH protocol, and will try to use my SSH key instead, for password-less authentication. The former will work, but you’ll have to keep entering your username and password every time. The latter is more secure.

Simple, but tricky. No, I don’t use a GUI for version control, and neither should you, trust me :)

8 thoughts on “Aside: Github’s Asking for my Password

  1. Https can be useful when deploying to shared environments, and you’re either unable or unwilling to set up an RSA key on the server

  2. Konstantin, thanks for the great tip! I was still thinking so until the last 2 minutes. So basically, if I use the 2nd method, the password will be saved/cached automatically?

Comments are closed.