所以,我在另一台机器上有一个repo设置.我已经提交并推送文件,他们在github.com上查看正常.现在,我已经git init
在另一台机器上跑了,我正试着拉.
# git remote set-url origin git@github.com:me/someproj.git
fatal: No such remote 'origin'
# git remote add origin https://github.com/me/someproj.git
# git pull
error: The requested URL returned error: 403 Forbidden while accessing https://github.com/me/someproj.git/info/refs
fatal: HTTP request failed
# git remote -v
origin https://github.com/me/someproj.git (fetch)
origin https://github.com/me/someproj.git (push)
# git pull origin
error: The requested URL returned error: 403 Forbidden while accessing https://github.com/me/someproj.git/info/refs
fatal: HTTP request failed
Run Code Online (Sandbox Code Playgroud)
您需要检查在推送到GitHub的计算机上使用的凭据(用户名/密码),并在新的本地存储库中重新使用这些凭据.
特别检查使用的URL类型:ssh(git@github.com:me/someproj.git
)或https(https://github.com/me/someproj.git
).
检查您是否使用2FA(双因素身份验证)或不使用该GitHub帐户和repos.
cd /path/to/new/local/repo
git remote add origin https://me@github.com/me/someproj.git
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
41360 次 |
最近记录: |