我有本地工作副本SourceTree。和所有的操作工作得很好,我可以简单的获取,推,拉等通过SourceTree。我只需要在SourceTree中不存在的force push。
我打开终端使git按-f
remote: Repository not found.
fatal: repository 'https://github.com/MyRepo/project.git/' not found
我不确定会有什么问题。
我有本地工作副本SourceTree。和所有的操作工作得很好,我可以简单的获取,推,拉等通过SourceTree。我只需要在SourceTree中不存在的force push。
我打开终端使git按-f
remote: Repository not found.
fatal: repository 'https://github.com/MyRepo/project.git/' not found
我不确定会有什么问题。
当前回答
如果你正在使用Git桌面应用程序,那么你应该尝试从Git桌面应用程序中推和拉,而不是终端。它会帮助你的。
其他回答
这里的问题是你的本地git无法将更改推送到远程 检查你的遥控器是否设置正确
git remote -v
如果没有正确设置,请尝试将您的遥控器设置为
git remote set-url origin https://username@github.com/MyRepo/project.git
然后尝试使用
git push -u origin master
也有可能你的本地git有不同的凭据,请检查一下。
对于Mac
打开KeyChain访问,并在密码类别上找到您的密码帐户(您可以在右上角KeyChain访问页面上搜索它)
当你找到它时,删除所有与git源代码控制相关的键。再试一次
I was trying to clone a repo and was facing this issue, I tried removing all git related credentials from windows credentials manager after that while trying to clone git was asking me for my credentials and failing with error invalid username or password. This was happening because the repo I was trying to clone was under an organization on github and that organization had two factor auth enabled and git bash probably do not know how to handle 2fa. So I generated a token from https://github.com/settings/tokens and used the github token instead of password while trying to clone the repo and that worked.
在我们的案例中,这只是一个在github中授予写权的案例。最初用户只有读权限,它给出了这个错误。
请在下面找到Windows的工作解决方案:
从“开始”菜单打开“控制面板”。 选择用户帐户。 选择“凭据管理器”。 点击“管理Windows凭证”。 删除所有与Git或GitHub相关的凭证。 一旦你删除了所有,然后尝试再次克隆。