Although things were working I just started getting "Permission denied (publickey)." errors while trying to push to GitHub.
The Permission denied (publickey) errors with git and GitHub on OS X article by Aral Balkan, unless otherwise expressly stated, is licensed under a Creative Commons Attribution-Noncommercial 2.0 UK: England License.
The solution was to create a config file under ~/.ssh/ as outlined at the bottom of the OS X section of this page.
Here's the file I added, as per the instructions on the page, and my pushes started working again:
Host github.com User git Port 22 Hostname github.com IdentityFile ~/.ssh/id_rsa TCPKeepAlive yes IdentitiesOnly yes
(Either that or it was a temporary hiccup with GitHub and I've fallen into an ad-hoc fallacy in thinking that the config file did the trick — it's bedtime so testing that will be for another day!)
If any git wizards have theories as to what could have caused my pushes to stop working and why this config file is necessary, I'd appreciate a quick note in the comments.
The Permission denied (publickey) errors with git and GitHub on OS X article by Aral Balkan, unless otherwise expressly stated, is licensed under a Creative Commons Attribution-Noncommercial 2.0 UK: England License.

Great tip, did the trick!
I also had faced same problem on Windows using msysGit. Creating a config file solved the problem. Thanks a lot !!
I was having a similar problem on ubuntu. This worked a treat. Thanks.
I had the same problem. Commits working one day, and then not the next.
For me, the solution was to re-run ssh-add. From the docs:
“Note: If you don’t use the default key names, or store your keys in a different path, you will need to run ssh-add path/to/my_key so that ssh knows where to find your key.”
I had done this previously, but somehow it must have gotten reset.