我有本地工作副本SourceTree。和所有的操作工作得很好,我可以简单的获取,推,拉等通过SourceTree。我只需要在SourceTree中不存在的force push。
我打开终端使git按-f
remote: Repository not found.
fatal: repository 'https://github.com/MyRepo/project.git/' not found
我不确定会有什么问题。
我有本地工作副本SourceTree。和所有的操作工作得很好,我可以简单的获取,推,拉等通过SourceTree。我只需要在SourceTree中不存在的force push。
我打开终端使git按-f
remote: Repository not found.
fatal: repository 'https://github.com/MyRepo/project.git/' 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
其他回答
我也面临着同样的问题
remote: Repository not found
fatal: repository 'https://github.com/MyRepo/project.git/' not found
我卸载了git凭证管理器并重新安装了它,然后我就可以很容易地将它拉到存储库中。下面是命令
$ git credential-manager uninstall
$ git credential-manager install
我有其他现有的github存储库,但我错误地认为我可以使用git命令创建存储库。我认为我的问题是没有个人访问令牌,但我仍然不能使用下面的命令来创建我的存储库。
git init
git add README.md
git commit -m "first commit"
git branch -M main
git remote add origin https://github.com/username/project.git
git push -u origin main
我不断地得到:
remote: Repository not found.
fatal: repository 'https://github.com/username/project.git/' not found
作为对
git push -u origin main
然而,我发现存储库需要创建使用github cli或在他们的github网站登录到我的帐户后。一旦我这样做了,一切都很顺利。
下面是我发现我不能用git命令创建github存储库的链接。
https://docs.github.com/en/get-started/importing-your-projects-to-github/importing-source-code-to-github/adding-an-existing-project-to-github-using-the-command-line
检查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 }
当存储库、团队名称或用户名更改时,就会发生这种情况。 有一个解决方案(我知道):恢复存储库名称。
我遇到了同样的问题,但是当我发现我已经从另一个帐户创建了存储库,并试图从另一个帐户推送代码时。这就是现在我只需要给访问另一个帐户和问题解决。你会发现从
设置>贡献者>添加人员