我有本地工作副本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实际上不会说这些事情,它只会说,你的凭证没有发现回购。
祝你好运。
在我们的案例中,这只是一个在github中授予写权的案例。最初用户只有读权限,它给出了这个错误。
我尝试了所有的方法,直到我意识到存储库所有者只给了我READ权限,所以Git会抛出“remote: repository not found”。
您必须生成一个新的令牌:这里的步骤是https://docs.github.com/en/github/authenticating-to-github/keeping-your-account-and-data-secure/creating-a-personal-access-token
在本地删除原点的控制
git remote remove origin
再次添加它,但现在使用您生成的令牌
git remote add origin https: // <token> @ <git_url> .git
然后按一下
git pull https://@<git_url>.git
注意:
什么是git_url?是当前项目示例的url: github.com/yourUser/yourProy
并删除<>字符
这里的问题是你的本地git无法将更改推送到远程 检查你的遥控器是否设置正确
git remote -v
如果没有正确设置,请尝试将您的遥控器设置为
git remote set-url origin https://username@github.com/MyRepo/project.git
然后尝试使用
git push -u origin master
也有可能你的本地git有不同的凭据,请检查一下。