Are you frustrated when git continues to ask for your user credentials?

Good chance if you’re reading this, you might be dealing with some frustration while attempting to push your files to Github. I myself have two factor authentication for my browser login, and SSH keys added to my account for CLI access. But, something happened to me last night that brought endless frustration.

Can you see what I’m doing? How could this happen if I already have other repos being pushed successfully?

Well, this is fairly common for users of Github. It all stems from one thing…your cloning method! For this repo, I cloned via HTTPS, which is why I was being prompted for my username and password, even though I already had SSH keys enabled. So here is what you do:

Go the repo of your desire and now ONLY copy the SSH link.

git remote set-url origin git@github.com:username/repo.git

That’s it.

Note: I hope you’ve already run git init in the directory or git fetch.