The requested URL returned error: 403 Forbidden while accessing github.com

前端 未结 5 774
别跟我提以往
别跟我提以往 2020-12-09 22:40

So, I have a repo setup, on another machine. I\'ve committed and pushed files and they view fine on github.com. Now, I have ran git init on another machine and

相关标签:
5条回答
  • 2020-12-09 22:49

    You need to check what credential (username/password) you are using on the machine where a push to GitHub succeed, and re-use those credential in your new local repo.

    Check especially the type of url used: ssh (git@github.com:me/someproj.git) or https (https://github.com/me/someproj.git).
    Check also if you were using 2FA (Two-Factor Authentication) or not for that GitHub account and repos.

    You can embed the right username in your url::

    cd /path/to/new/local/repo
    git remote add origin https://me@github.com/me/someproj.git
    
    0 讨论(0)
  • 2020-12-09 22:49

    You can try the git remote -v command to check the remote repo URL is ok. If it is not, you should try

    git remote set-url origin repo-url
    

    To fix any typos

    0 讨论(0)
  • 2020-12-09 22:50

    When trying to access https://github.com/me/someproj.git/info/refs from the browser you'll notice the following message which associated with a 403 status code:

    Please upgrade your git client. GitHub.com no longer supports git over dumb-http: https://github.com/blog/809-git-dumb-http-transport-to-be-turned-off-in-90-days

    If you are using git prior to 1.6.6, try to update it or better use a SSH protocol.

    Also check your setup with git config --global user.name and git config --global user.password.

    0 讨论(0)
  • 2020-12-09 23:00

    If you use two account in same computer it will throw this error.

    In windows 10 Control Panel -> User Accounts -> Manage your credentials. Remove the github account.

    0 讨论(0)
  • 2020-12-09 23:11

    For those whose problem is not solved with deleting the credential or url change.

    I strongly recommend to check that you have the permission to push to the repo. To make sure, ask the repo's admin to give you the WRITE permission in the 'Manage Access' section of the repo's settings. Hope this works for you.

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