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

我打开终端使git按-f

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

我不确定会有什么问题。


当前回答

如果你在windows上得到控制面板-> windows凭据,然后从通用凭据选项删除github凭据。然后尝试克隆

其他回答

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

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

其他答案都不适合我,我可以在浏览器中查看回购,但当试图获取或做一个新的克隆时,得到了Not Found错误。出于某种原因,这解决了问题:

在浏览器中访问Github repo。 点击绿色的“代码”按钮(如下图)。 选择“使用Github桌面打开”。 Github桌面应该打开并成功获取。 你现在可以关闭Github桌面,从控制台或你选择的Git软件中获取或克隆。

从系统中删除所有github.com凭据详细信息。

对于mac

从Keychain Access中删除github.com密码。

对于windows

从凭证管理器中删除凭证。

试试这个,对我很管用。

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

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

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

然后,

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