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

我打开终端使git按-f

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

我不确定会有什么问题。


当前回答

您必须生成一个新的令牌:这里的步骤是https://docs.github.com/en/github/authenticating-to-github/keeping-your-account-and-data-secure/creating-a-personal-access-token

在本地删除原点的控制

 git remote remove origin

再次添加它,但现在使用您生成的令牌

git remote add origin https: // <token> @ <git_url> .git

然后按一下

git pull https://@<git_url>.git

注意:

什么是git_url?是当前项目示例的url: github.com/yourUser/yourProy

并删除<>字符

其他回答

操作系统

使用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

这里的问题是windows凭据管理器,请去控制面板,搜索凭据管理器,并删除它关于github的所有内容

我看到了这个致命的问题:当人们尝试在免费层上从私人GitHub帐户中推拉时,存储库现在更经常地发现错误。以下是最常见的解决方案:

您没有验证 您的密码已更改 你不是合作者 不正确的大小写或拼错的单词 已删除git存储库

Windows凭证管理器?

有时Windows凭证管理器会缓存你的u/p,并在幕后传递它。如果您最近更改了密码,或者使用了不同的用户名,您可能需要进入凭据管理器并清除GitHub的现有条目。

我也面临着同样的问题

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

我卸载了git凭证管理器并重新安装了它,然后我就可以很容易地将它拉到存储库中。下面是命令

$ git credential-manager uninstall

$ git credential-manager install

在我的情况下,我需要在Linux上使用Ctrl + H打开目录来查看隐藏的文档,所以我进入Git配置并在URL中取出。Git。