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

我打开终端使git按-f

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

我不确定会有什么问题。


当前回答

试试这个,对我很管用。

git remote rm origin
git remote add origin https://github.com/your-username/{{project-name}}.git

其他回答

〇解决方案

问题,

$ git clone https://github.com/abc/def.git
Cloning into 'def'...
remote: Repository not found.
fatal: repository 'https://github.com/abc/def.git/' not found

解决方案- 卸载凭据管理器-

abc@DESKTOP-4B77L5B MINGW64 /c/xampp/htdocs
$ git credential-manager uninstall

abc@DESKTOP-4B77L5B MINGW64 /c/xampp/htdocs
$ git credential-manager install

它的工作原理……

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

git config credential.helper "" 

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

在我的情况下,我不能克隆github由于用户是错误的。

转到~/.gitconfig 然后尝试删除这行代码(只需删除它,然后保存文件)。

[user]
    name = youruser
    email = youruser@domain.com

或者尝试在CMD或终端中使用一行代码:git config——global——remove-section user

并尝试再次做git克隆。希望它能帮你度过美好的一天。><

请在下面找到Windows的工作解决方案:

从“开始”菜单打开“控制面板”。 选择用户帐户。 选择“凭据管理器”。 点击“管理Windows凭证”。 删除所有与Git或GitHub相关的凭证。 一旦你删除了所有,然后尝试再次克隆。

在我们的案例中,这只是一个在github中授予写权的案例。最初用户只有读权限,它给出了这个错误。