I’ve been using Git for a while now, but the constant requests for a password are starting to drive me up the wall.
I’m using Mac OS X and GitHub, and I set up Git and my SSH keys as instructed by GitHub’s Set Up Git page.
I’ve also added the github SSH key to my Mac OS X keychain, as mentioned on GitHub’s SSH key passphrases page. My public key is registered with Git.
Nevertheless, every time I try to Git pull, I have to enter my username and password. Is there something other than an SSH key that I need to set up for this?
I think you may have the wrong Git repository URL.
Open
.git/configand find the [remote “origin”] section. Make sure you’re using the SSH one:You can see the SSH URL in the main page of your repository if you click Clone or download and choose ssh.
And NOT the
httpsorgitone:You can now validate with just the SSH key instead of the username and password.
If Git complains that
'origin' has already been added, open the.configfile and edit theurl = "..."part after[remote origin]asurl = ssh://github/username/repo.gitThe same goes for other services. Make sure the address looks like:
protocol://something@urlE.g.
.git/configfor Azure DevOps: