如果没有什么别的问题的话,推荐使用SSH的方式。请参考:http://stackoverflow.com/questions/7438313/pushing-to-git-returning-error-code-403-fatal-http-request-failed
Pushing to Git returning Error Code 403 fatal: HTTP request failed
up vote241down votefavorite 119 |
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.
Also set it up with verbose mode. I‘m still pretty baffled.
These are the versions of git and curl that I have:
|
||||||||||||||||||||
|
27 Answers
up vote379down voteaccepted |
I just got the same problem and just figured out what‘s cause. Github seems only supports ssh way to read&write the repo, although https way also displayed ‘Read&Write‘. So you need to change your repo config on your PC to ssh way:
|
||||||||||||||||||||
|
up vote160down vote |
To definitely be able to login using
Then you‘ll be asked for a password when trying to In fact, this is on the http authentication format. You could set a password too:
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.
|
||||||||||||||||||||
|
up vote63down vote |
One small addition to Seans answer. Instead of editing In your case it should be:
I find it easier and cleaner, than messing around with dot-files.
|
||||
|
up vote27down vote |
The other answers that suggest switching to SSH sort of miss the point. HTTPS is supported, but you must log in with you GITHUB password, not your SSH passphrase (which was what was giving me the same exact error). I was having the same problem, but making sure to use my actual GitHub password at the terminal password prompt fixed the solution with no alteration to the config, or resorting to SSH. The reason it is important to note this, is many public institutions (such as my school) will block SSH, but allow HTTPS (which is the only reason I started cloning over HTTPS in the first place). Hope that helps anyone else having the same issue...
|
||||||||
|
up vote16down vote |
Edit Find Change it from where
|
|||
add a comment |
up vote12down vote |
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
|
||||
|
up vote7down vote |
Upgrade your git. GitHub has answered this question at https://help.github.com/articles/error-the-requested-url-returned-error-403.
|
||||
|
up vote6down vote |
Figured it out. I cloned over HTTPS. Setting up my public SSH keys, cloning over SSH, and pushing over SSH fixed it.
|
||||||||||||
|
up vote4down vote |
Just add you username into url like this : https://[email protected]/islam9/bootstrap-rtl please check: http://islamkhalil.wordpress.com/2012/12/06/github-error-pushing-to-git-returning-error-code-403-fatal/
|
||||
|
up vote4down vote |
A 403 code is "Forbidden". The server saw your request and refused it. Do you have permission to push to that repository?
|
||||
|
up vote2down vote |
For anyone curious, my mac machine vs lucid vm ran git 1.7.6 vs 1.7.0.4, and the exact same repo was pushable from my mac (newer git) but not the VM Same curl version. Perhaps some older git versions don‘t support https pushes?
|
||||||||
|
up vote2down vote |
change it from
to
It works! Do not forget the "git" before the "@".
|
|||
add a comment |
up vote2down vote |
Sometimes there is nothing wrong with settings, and there are some problems on github servers. https://status.github.com - current status of github :)
|
||||
|
up vote1down vote |
I had this problem right now, and it turned out that my server /etc/resolver.conf file had a bad ip address. Might help others.
|
||
add a comment |
up vote1down vote |
It could be an accounting issue. The Github account of the upstream (private) repo owner may not be financial. I‘ve seen this where the client‘s credit card expired.
|
||
add a comment |
up vote1down vote |
I figured out my own variation of this problem. The issue was not changing the protocol from https to ssl, but instead, setting the Github global username and email! (I was trying to push to a private repository.
|
||||
|
up vote1down vote |
After changing https to http within gitbox app, it worked for me.
|
||||
|