I recently decided to do a bit of finals procrastination by working on a problem that’s been a mild nuisance for the past few months. My Google Contacts have had a problem with delineating first and last names, but that’s a story for another post. If you’re interested in the repo as it develops, check out https://github.com/andrewychoi/fix_contacts
What I had been having trouble with was the consistent need to enter a username and password for every time that I wanted to git push
to the server. I went into the GitHub user menu and added an SSH key, but access to my accounts was still problematic.
The problem was that my project_directory/.git/config
file still told me that origin
was to be reached over HTTPS. Changing that to SSH solved the protocol access problem. For exactness, I changed the line
https://github.com/username/project.git
to
ssh://github.com/username/project.git
Now, however, I was greeted with a
Permission denied (publickey).
fatal: The remote end hung up unexpectedly
At this point, I started searching the web for the solution to this problem. It turns out that I needed to SSH in as the git
user. The fix was to change
ssh://github.com/username/project.git
to
ssh://git@github.com/username/project.git
Now everything works like a charm!
> git pull
Already up-to-date.
> git push
Everything up-to-date.