[英]Changed credentials on Github and now I can't pull from a remote repository
I changed my password on Github. 我在Github上更改了密码。 After doing that I am able to run local commands but I can't pull or push to a remote repository.
完成此操作后,我可以运行本地命令,但无法拉入或推入远程存储库。 I get the error
remote: Repository not found.
我收到错误
remote: Repository not found.
I tried removing and re-adding the remote branch but that did not work. 我尝试删除并重新添加远程分支,但这没有用。 When I run
ssh -T git@github.com
, it tells me that I am, in fact, authenticated. 当我运行
ssh -T git@github.com
,它告诉我实际上已经通过了身份验证。 Any ideas? 有任何想法吗?
Thanks. 谢谢。
我通过在存储库URL中包含用户名解决了该问题。
If you really want to use HTTP Basic Authentication instead of ssh to push to GitHub, which it looks like you don't , the steps to troubleshoot: 如果您确实想使用HTTP基本身份验证而不是ssh推送到GitHub(看起来好像不是) ,则进行故障排除的步骤:
Confirm the accuracy of the remote push HTTPS URL syntax via
git remote get-url --push <name>
通过
git remote get-url --push <name>
确认远程推送HTTPS URL语法的准确性Confirm GitHub access permissions via API endpoint
GET /repos/:owner/:repo
通过API端点
GET /repos/:owner/:repo
确认GitHub访问权限Remove any cached credentials in OSX Keychain or _netrc credential helper as per @VonC 's answer to "Changed GitHub password, no longer able to push back to the remote" :
根据@VonC对“更改的GitHub密码,不再能够推回远程 服务器 ”的回答,删除OSX钥匙串或_netrc凭据帮助器中的所有缓存凭据:
You can also bypass credentials caching altogether by embedding credentials information inside your push URL: 您还可以通过将凭据信息嵌入推送URL中来完全绕开凭据缓存:
git remote \
set-url ${remoteName} \
https://${username}:${password}@github.com/${username}/$[repoName}.git
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.