I was able to clone a copy of this repo over HTTPS authenticated. I\'ve made some commits and want to push back out to the GitHub server. Using Cygwin on Windows 7 x64.
To definitely be able to login using https
protocol, you should first set your authentication credential to the git Remote URI:
git remote set-url origin https://yourusername@github.com/user/repo.git
Then you'll be asked for a password when trying to git push
.
In fact, this is on the http authentication format. You could set a password too:
https://youruser:password@github.com/user/repo.git
You should be aware that if you do this, your github password will be stored in plaintext in your .git directory, which is obviously undesirable.
One small addition to Sean's answer.
Instead of editing .git/config
file manually, you can use git remote set-url
command.
In your case it should be:
git remote set-url origin ssh://git@github.com/derekerdmann/lunch_call.git
I find it easier and cleaner, than messing around with dot-files.
A 403 code is "Forbidden". The server saw your request and refused it. Do you have permission to push to that repository?
Same error and resolution on Mac OS X.
Everything was working fine till I created a new account on GitHub and tried to push
$ git push -u origin master
And got the error:
remote: Permission to NEWUSER/NEWREPO.git denied to OLDUSER. fatal: unable to access ‘https://github.com/NEWUSER/NEWREPO.git/': The requested URL returned error: 403
It should have fixed by setting the user.name either for global or current repo
$ git config –-global user.name NEWUSER
$ git config user.name NEWUSER
But it didn’t.
I got it fixed by deleting the OLDUSER associated with GitHub from Keychain Access app under Passwords section. Then the push command went successful.
$ git push -u origin master
reference
For those having permission denied 403 error while using ssh(according to Xiao) or http urls try these commands
>git config --global --unset-all credential.helper
>git config --unset-all credential.helper
with administrator rights
>git config --system --unset-all credential.helper
I think @deepwaters got the answer correct for older versions. The HTTPS URL needs to have the username. I had git 1.7.0.4 and git push origin master
wouldn't even ask for a password till I added it.