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

我打开终端使git按-f

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

我不确定会有什么问题。


当前回答

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

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

其他回答

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

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

然后,

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

这可能是身份验证的问题。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/)。

我也有这个问题。 为了解决这个问题,I: 1. 移动我的本地。dotfiles到_.dotfiles_bak 2. 克隆我的远程git存储库 3.从_.dotfiles_bak拷贝了我所有的文件 到。dotfiles -除了。git文件夹 3.然后我又可以在当地工作了: 编辑,承诺和推动

我也有同样的问题

通过检查http。在git配置中的代理值(我的是不正确的和不需要的), 因此我删除了http。从git配置的代理值

命令:

列出文件中的配置项

git config --list

删除代理

git config --global --unset http.proxy

问题解决了!

试试这个,对我很管用。

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