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

我打开终端使git按-f

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

我不确定会有什么问题。


当前回答

这里的问题是你的本地git无法将更改推送到远程 检查你的遥控器是否设置正确

git remote -v

如果没有正确设置,请尝试将您的遥控器设置为

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

然后尝试使用

git push -u origin master

也有可能你的本地git有不同的凭据,请检查一下。

其他回答

当存储库、团队名称或用户名更改时,就会发生这种情况。 有一个解决方案(我知道):恢复存储库名称。

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

我尝试了所有的方法,直到我意识到存储库所有者只给了我READ权限,所以Git会抛出“remote: repository not found”。

在我的情况下,上述解决方案都不起作用。

我通过将remote.origin.url从https切换到ssh来解决这个问题:

验证git配置:

git config --list

应该是这样:

...
remote.origin.url=https://github.com/ORG/repo-name.git
...

使用SSH更新remote.origin.url:

git remote set-url origin git@github.com:ORG/repo-name.git

检查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 }