我有本地工作副本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文件(隐藏文件夹),然后再次上传解决了这个问题。
从系统中删除所有github.com凭据详细信息。
对于mac
从Keychain Access中删除github.com密码。
对于windows
从凭证管理器中删除凭证。
在Visual Studio中从Github克隆时,点击Github链接上的“浏览存储库”选项,它将要求登录。
您必须生成一个新的令牌:这里的步骤是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
并删除<>字符
确保您拥有正确的访问权限,当分支受到保护时可能会发生这种情况。
我刚刚浪费了四个小时在这上面。