Pushing to Git returning Error Code 403 fatal: HTTP request failed

后端 未结 30 1171
轻奢々
轻奢々 2020-11-22 04:52

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.

相关标签:
30条回答
  • 2020-11-22 05:08

    This works for me -:

    git remote set-url origin https://username@github.com/user/repo.git
    

    Hope it helps

    0 讨论(0)
  • 2020-11-22 05:08

    Upgrade your git. GitHub has answered this question at https://help.github.com/articles/error-the-requested-url-returned-error-403.

    0 讨论(0)
  • What worked for me:

    My repo was a fork and still linked to the the parents repo.

    git remote -v
    

    Will tell you if it is your repo or not.

    git remote set-url origin https://github.com/USERNAME/OTHERREPOSITORY.git
    

    Allows you to reconfigure it to your repo and then allow you to push.

    0 讨论(0)
  • 2020-11-22 05:09

    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...

    0 讨论(0)
  • 2020-11-22 05:10

    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.

    0 讨论(0)
  • 2020-11-22 05:12

    I had the same issue. My case was: I'd initialized git repo locally before I created it on github, then I tried to add remote branch. I solved my issue by changing the order of actions: created a repo on github site, then inited it locally. But it's not the case fr them who like to do all from command line as me.

    0 讨论(0)
提交回复
热议问题