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

我打开终端使git按-f

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

我不确定会有什么问题。


当前回答

操作系统

使用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

其他回答

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

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

然后,

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

我也面临着同样的问题

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

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

$ git credential-manager uninstall

$ git credential-manager install

我有同样的问题,并发现我在~/中有另一个密钥文件。ssh到不同的GitHub存储库。不知怎么的,它代替了新的。

如果回购是私有的,请确保您已接受回购邀请。如果回购是私有的,而不接受回购邀请,如果你直接推送更改,它会给出相同的错误。

如果你正在使用Git桌面应用程序,那么你应该尝试从Git桌面应用程序中推和拉,而不是终端。它会帮助你的。