我有本地工作副本SourceTree。和所有的操作工作得很好,我可以简单的获取,推,拉等通过SourceTree。我只需要在SourceTree中不存在的force push。

我打开终端使git按-f

remote: Repository not found.
fatal: repository 'https://github.com/MyRepo/project.git/' not found

我不确定会有什么问题。


当前回答

因为您可能没有首先将远程git存储库标识到您的终端。

git remote set-url origin https://github.com/MyRepo/project.git

然后,

git add .
git commit -m "initial commit"
git push origin master

其他回答

此消息可以在找到存储库时发生,但我们没有提交访问权。不是措辞巧妙的!

在克隆了老板为我创建的gitHub存储库后,我收到了repo-not-found消息。我可以在本地复制和提交,但不能向上推提交。存储库所有者没有给我写权限。通过请求对回购所有者的写访问来解决。

确保您拥有正确的访问权限,当分支受到保护时可能会发生这种情况。

我刚刚浪费了四个小时在这上面。

我也面临着同样的问题

remote: Repository not found
fatal: repository 'https://github.com/MyRepo/project.git/' not found

我卸载了git凭证管理器并重新安装了它,然后我就可以很容易地将它拉到存储库中。下面是命令

$ git credential-manager uninstall

$ git credential-manager install

在ubuntu上,我遇到了这个问题。我通过运行下面的命令重置凭据帮助器来解决这个问题。

git config credential.helper "" 

运行此命令后,当您拉或推时,将要求您再次输入凭据。

这可能是身份验证的问题。SourceTree缓存你的github凭据(用于通过https访问存储库),但从终端你必须使用凭据配置git (https://help.github.com/articles/creating-an-access-token-for-command-line-use/)或使用git+ssh和ssh密钥对(https://help.github.com/articles/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent/)。