简体   繁体   English

更改了Github上的凭据,现在我无法从远程存储库中提取

[英]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(看起来好像不是) ,则进行故障排除的步骤:

  1. 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语法的准确性

  2. Confirm GitHub access permissions via API endpoint GET /repos/:owner/:repo 通过API端点GET /repos/:owner/:repo确认GitHub访问权限

  3. 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.

相关问题 无法从github提取更改-权限被拒绝(公钥)。 严重的:无法从远程存储库读取 - can't pull changes from github - Permission denied (publickey). fatal: Could not read from remote repository 可以从私有 GitHub 存储库克隆和拉取,但不能拉取 - Can clone and pull from private GitHub repository, but can't pull 试图从 github 拉我得到错误远程:找不到存储库 - Trying to pull from github i get error remote: Repository not found 我无法通过拉取从 github 下载存储库。 本地目录仍为空 - I can't download repository from github with pull. Local directory still empty 我创建了 github 远程存储库,但我无法在远程存储库中提交 - i made github remote repository but i can't commit in remote repository Github从没有证书的特定远程分支中拉取 - Github pull from specific remote branch without credentials 为什么我不能将此远程GitHub存储库添加为本地GIT存储库? - Why I can't add this remote GitHub repository to my local GIT repository as remote? 如何自动将更改从远程存储库推送到Github? - How can I automatically push changes from a remote repository to Github? 如何使用 GitPython 拉取远程存储库? - How can I pull a remote repository with GitPython? 如何获取远程GitHub存储库的上游更改? - How do I pull upstream changes of a remote GitHub repository?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM