请求的URL返回错误:403访问github.com时禁止访问 [英] The requested URL returned error: 403 Forbidden while accessing github.com

查看:143
本文介绍了请求的URL返回错误:403访问github.com时禁止访问的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以,我在另一台机器上有一个回购设置。我已经提交并推送了文件,并且他们在github.com上查看的很好。现在,我已经在另一台机器上运行了 git init ,并且正在尝试执行。

 #git remote set-url origin git@github.com:me / someproj.git 
fatal:没有这样的远程'origin'

#git remote add origin https: //github.com/me/someproj.git

#git pull
错误:请求的URL返回错误:403禁止访问https://github.com/me/someproj。 git / info / refs

致命错误:HTTP请求失败

#git remote -v
origin https://github.com/me/someproj.git(获取)
原点https://github.com/me/someproj.git(推送)

#git pull原点
错误:请求的URL返回错误:403 Forbidden while访问https://github.com/me/someproj.git/info/refs

致命错误:HTTP请求失败


解决方案

您需要检查您在推送GitHub成功的机器上使用的凭证(用户名/密码),并重新使用这些凭据在您的新本地回购。



特别检查使用的网址类型:ssh( git@github.com:me / someproj.git )或https( https://github.com/me/someproj.git )。

请检查您是否使用2FA(双因素认证)或不是用于该GitHub帐户和回购。



您可以在您的网址中嵌入正确的使用者名称 a> ::

  cd / path / to / new / local / repo 
git remote add origin https:/ /me@github.com/me/someproj.git


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 I'm trying to pull.

# 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

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

这篇关于请求的URL返回错误:403访问github.com时禁止访问的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆