我有本地工作副本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
我不确定会有什么问题。
当前回答
在我们的案例中,这只是一个在github中授予写权的案例。最初用户只有读权限,它给出了这个错误。
其他回答
我通过删除.git文件(隐藏文件夹),然后再次上传解决了这个问题。
从系统中删除所有github.com凭据详细信息。
对于mac
从Keychain Access中删除github.com密码。
对于windows
从凭证管理器中删除凭证。
您以前可能使用其他GitHub凭据登录。这就是错误发生的原因。
通常,mac将您的GitHub凭据存储到密钥链访问工具。你以前的git帐户详细信息在那里。所以它与你当前在其他账户中的git回购不匹配。
解决方法简单明了,
进入你的mac的钥匙链访问。 在左边的类别下,你可以找到所有的项目。单击。 右边顶部搜索“git”。 你会得到一些关于Github的项目。 删除所有这些项目。
就这样,给你。
再推一下。它会询问你git的用户名和密码。您的新凭证将再次存储在钥匙链中,您的推送将完成。
华友世纪!
如果你需要更多的帮助,再来找我。
谢谢
操作系统
使用VS Code和一个没有密码的密钥:
removed eval "$(ssh-agent -s)" line from my ~/.zshrc file to stop running it in the background (first step on Github's Generating a new SSH key article) verified my .ssh/config entry for *.github.com did not have a UseKeychain line used simply ssh-add ~/.ssh/id_ed25519 with NO --apple-use-keychain on VS Code "Git: Add remote..." allowed/authorized my Github account connection (you don't really need to add a remote) applies a new "vscodevscode.github-authentication" entry in Mac's Keychain Access app closed all shells and VS Code, restarted and the repo is now always found
I was trying to clone a repo and was facing this issue, I tried removing all git related credentials from windows credentials manager after that while trying to clone git was asking me for my credentials and failing with error invalid username or password. This was happening because the repo I was trying to clone was under an organization on github and that organization had two factor auth enabled and git bash probably do not know how to handle 2fa. So I generated a token from https://github.com/settings/tokens and used the github token instead of password while trying to clone the repo and that worked.