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

我打开终端使git按-f

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

我不确定会有什么问题。


当前回答

禁用GIT证书对我有帮助:

git config --global --unset credential.helper

其他回答

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

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

操作系统

使用VS Code和一个没有密码的密钥:

removed eval "$(ssh-agent -s)" line from my ~/.zshrc file to stop running it in the background (first step on Github's Generating a new SSH key article) verified my .ssh/config entry for *.github.com did not have a UseKeychain line used simply ssh-add ~/.ssh/id_ed25519 with NO --apple-use-keychain on VS Code "Git: Add remote..." allowed/authorized my Github account connection (you don't really need to add a remote) applies a new "vscodevscode.github-authentication" entry in Mac's Keychain Access app closed all shells and VS Code, restarted and the repo is now always found

检查url s.source是否正确。

为我树立榜样

// fail Project>>t<<est

s.source = { :git => '.../Projecttest-iOS', :tag => s.version.to_s }

// success    Project>>T<<est
s.source = { :git => '.../ProjectTest-iOS', :tag => s.version.to_s }

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

git config credential.helper "" 

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

您可以尝试删除目录中的.git文件,并重新执行所有操作将解决您的问题!