Git - 远程:未找到存储库
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/37813568/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Git - remote: Repository not found
提问by Matrosov Alexander
I have SourceTree with local working copy. And all operations work good, I can simple fetch, push, pull and etc via SourceTree. I just needed to make force push which does not exist in SourceTree.
我有带有本地工作副本的 SourceTree。并且所有操作都运行良好,我可以通过 SourceTree 进行简单的获取、推送、拉取等操作。我只需要进行 SourceTree 中不存在的强制推送。
I opened terminal made git push -f
我打开终端做了 git push -f
remote: Repository not found.
fatal: repository 'https://github.com/MyRepo/project.git/' not found
I am not sure what can be an issue.
我不确定有什么问题。
回答by Zeeshan Ansari
Remove the all github.com credential details from the system.
从系统中删除所有 github.com 凭据详细信息。
For mac
苹果机
Delete the github.com password from the Keychain Access.
从钥匙串访问中删除 github.com 密码。
For window
窗户用
Delete the credentials from Credential Manager.
从凭据管理器中删除凭据。
回答by Ajay
I was also facing the same issue
我也面临同样的问题
remote: Repository not found
fatal: repository 'https://github.com/MyRepo/project.git/' not found
I uninstalled the git credentials manager and reinstalled it and then I could easily pull and push to the repository. Here are the commands
我卸载了 git 凭证管理器并重新安装了它,然后我可以轻松地拉取和推送到存储库。这是命令
$ git credential-manager uninstall
$ git credential-manager install
回答by Mukesh Salaria
Please find below the working solution:
请在下面找到工作解决方案:
- Open Control Panel from the Start menu.
- Select User Accounts.
- Select the "Credential Manager".
- Click on "Manage Windows Credentials".
- Delete any credentials related to Git or GitHub.
- Once you deleted all then try to clone again.
- 从开始菜单打开控制面板。
- 选择用户帐户。
- 选择“凭据管理器”。
- 单击“管理 Windows 凭据”。
- 删除与 Git 或 GitHub 相关的任何凭据。
- 删除所有内容后,请再次尝试克隆。
回答by Emre Bolat
Because you probably did not identify the remote git repository to your terminal first.
因为您可能没有首先将远程 git 存储库识别到您的终端。
git remote set-url origin https://github.com/MyRepo/project.git
and then,
进而,
git add .
git commit -m "force push"
git push origin master --force
回答by Mauget
This message can occur when a repository IS found, but we don't have commit access. Not well-worded!
当找到存储库但我们没有提交访问权限时,可能会出现此消息。不太好表达!
I received the repo-not-found message after cloning a gitHub repository created for me by my boss. I could clone and commit locally, but could not push commits upstream. The repository owner had not given me write access. Solved by a plea for write access to the repo owner.
在克隆了我的老板为我创建的 gitHub 存储库后,我收到了 repo-not-found 消息。我可以在本地克隆和提交,但无法向上游推送提交。存储库所有者没有给我写权限。通过请求对 repo 所有者的写访问权限解决。
回答by Thirumoorthi
The problem here is windows credentials manager, Please goto control panel and search for credentials manager and delete all contents of it regarding github
这里的问题是 windows 凭证管理器,请转到控制面板并搜索凭证管理器并删除它关于 github 的所有内容
回答by Bharathan Kumaran
This issue here is you local git is not able to push the changes to the remote Check your remote is set correctly by
这里的问题是您本地的 git 无法将更改推送到远程检查您的远程设置是否正确
git remote -v
if it is not set properly try setting your remote as
如果未正确设置,请尝试将遥控器设置为
git remote set-url origin https://[email protected]/MyRepo/project.git
Then try pushing using
然后尝试使用
git push -u origin master
Also there is a possibility of your local git has different credentials, please check that also.
此外,您的本地 git 可能具有不同的凭据,请也检查一下。
回答by ModX
In my case none solution above worked.
就我而言,上述解决方案均无效。
I solved it by switching remote.origin.url
from httpsto ssh:
我通过remote.origin.url
从https切换到ssh解决了这个问题:
verify git configuration:
验证git配置:
git config --list
should be like:
应该是这样的:
...
remote.origin.url=https://github.com/ORG/repo-name.git
...
update remote.origin.url
with sshto be used:
remote.origin.url
使用ssh更新:
git remote set-url origin [email protected]:ORG/repo-name.git
回答by mohsen
For Mac
对于 Mac
Open KeyChain Access and find your pssword account on password category ( you can search it on top right keychain access page)
打开 KeyChain Access 并在密码类别中找到您的 pssword 帐户(您可以在右上角的钥匙串访问页面上搜索它)
when you find it , delete all keys related to your git source control. and try it again
找到后,删除与 git 源代码管理相关的所有键。然后再试一次
回答by sawan nirala
On Mac
在 Mac 上
If you are trying to clone the repo.... Then this problem is may occur because you don't have repo present in the github account present in Keychain Access. For resolution try to clone with the account name like
如果您尝试克隆 repo.... 那么可能会出现此问题,因为Keychain Access中的 github 帐户中没有 repo 。为了解决问题,请尝试使用帐户名称进行克隆,例如
git clone https://[email protected]/org/repo.git
git clone https://[email protected]/org/repo.git
Replace
代替
- username with your GitHub username
- org with yours organisation name
- repo with repository name
- 用户名和你的 GitHub 用户名
- org 与您的组织名称
- 带有存储库名称的 repo