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

前端 未结 5 789
别跟我提以往
别跟我提以往 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
    

提交回复
热议问题