我有本地工作副本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
我不确定会有什么问题。
当前回答
对于Mac
打开KeyChain访问,并在密码类别上找到您的密码帐户(您可以在右上角KeyChain访问页面上搜索它)
当你找到它时,删除所有与git源代码控制相关的键。再试一次
其他回答
所以你的url当前看起来如下所示
https://github.com/RevanthM/Log_Monitoring
它应该是这样的
https://RevanthM@github.com/RevanthM/Log_Monitoring
不同的是,在url的开头,我添加了我的github用户名,后面跟着一个@符号。
我有同样的问题,并发现我在~/中有另一个密钥文件。ssh到不同的GitHub存储库。不知怎么的,它代替了新的。
我有其他现有的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
您可能正在尝试推送到私有存储库。在这种情况下,您必须请求管理员验证Collaborator访问。
对于Mac
打开KeyChain访问,并在密码类别上找到您的密码帐户(您可以在右上角KeyChain访问页面上搜索它)
当你找到它时,删除所有与git源代码控制相关的键。再试一次