TL;DR
You need to switch your credentials. Start with VonC's answer here.
What's going on
Note specifically the URL here:
... unable to access 'https://github.com/...
'
Start with this: git push
does not use your configured user.email
! It uses the URL you provide, usually via a remote name like origin
: there's a setting, remote.origin.url
, that holds the URL.
The URL itself begins with one of the various "scheme" names, like ssh://
or https://
. After the double slash is a host name—technically, this can include user:password@host.dom.ain
but don't do that; at most put in user@host.dom.ain
—and then the rest of the string is provided to that host. Or, you can use git@github.com:path/to/repo
, which is short for ssh://git@github.com/path/to/repo
.
Since you specifically asked for https
, Git will get the user name and password from a credential helper. The specific credential helper that Git uses depend on a lot of things. The most important, in order, are these two:
What is your host OS? Windows has Windows-specific credential helpers, OS X has osx-keychain based helpers, and others have the store
and cache
helpers.
What version of Git are you using? Almost all modern versions are much better than the ancient ones, but there are still some ancient (1.7 and early 1.8) Git versions still in use.
For (much) more about credential helpers when using HTTPS, see Is there a way to skip password typing when using https:// on GitHub? I note that you added:
here's an additional weird thing: I can push using the Github Windows client but I can't push using the Git GUI.
This implies that you're using Windows (which I avoid...). Obviously their Github Windows Client is using a different credential helper than the Git GUI.
I prefer to use SSH, which means I set up my ssh keys and set my URL to use ssh://git@github.com/...
. When using SSH, GitHub ends up looking up the public key that your SSH client—your Git, in other words—sends to find who is connecting, and then uses that to decide who you are and whether you can access that repository.
So where does your user.email
get used?
Once your Git gets authorized and is successfully talking to another Git on GitHub, your Git then pushes commits. The commits themselves—which you've already made, at some point well before you ran git push
—contain strings derived from your user.name
and user.email
settings.
It's git commit
, not git push
, that uses the user.name
and user.email
settings. These are just configuration settings, not credentials.
In other words, by the time you run git push
, it's way past the time Git was looking at your user.email
setting. What you have set now no longer matters at all. What you had set in the past matters if and only if you push some commits that used its setting.