Github Tip: What to do if Github is asking for Username and Password

Recently I had a strange thing happen with a new project hosted by Github, by which every transaction with the server requried a username and password. Thankfully, this Stackoverflow post helped me resolve it.

If Github is constantly asking for your credentials when you do a clone, pull, or push, and you know you have your SSH key already in your Github profile, check to see if you set up your local repository with the HTTPS version of the repository when you cloned it instead of the SSH version. If you can remember.

In either case, do the following:

  1. Blow away (or rename safely) your current repository directory.
  2. Go to the Github page of your project.
  3. Next to the text box that contains the URL for your repository to use for cloning purposes, click “SSH” to activate it. You will see the address change from “https://…” to “[email protected]…”.
  4. Copy the new address and use that to re-clone your repository in a fresh directory.

Hope that helps.