我有本地工作副本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
我不确定会有什么问题。
当前回答
增加“个人访问令牌”
自2021年以来,Github支持PAT而不是名称/密码(阅读这里如何创建和使用一个),所以我们只是把它添加到远程起源。
在Windows上
访问。git文件夹,打开配置文件进行编辑。如。vim配置。 将URL更改为 https://github.com/ <用户名> / < repo_name > . 来 https:// [personal-access-token] @github.com/ <用户名> / < repo_name > . 其中[personal-access-token]是你在github创建的PAT散列。 保存配置文件,现在推送应该可以工作了。
快捷方式:
git remote remove origin
git remote add origin https://[personal-access-token]@github.com/username/repo_name.git
更新
生成令牌时,如果希望令牌长时间工作,请选择“No expiration”。
其他回答
如果你没有写权限,只有读权限,就会发生这种情况。 如果它是一个私有存储库,您应该被添加为合作者。 检查你的证件是否正确。
Git实际上不会说这些事情,它只会说,你的凭证没有发现回购。
祝你好运。
从系统中删除所有github.com凭据详细信息。
对于mac
从Keychain Access中删除github.com密码。
对于windows
从凭证管理器中删除凭证。
我也面临着同样的问题
remote: Repository not found
fatal: repository 'https://github.com/MyRepo/project.git/' not found
我卸载了git凭证管理器并重新安装了它,然后我就可以很容易地将它拉到存储库中。下面是命令
$ git credential-manager uninstall
$ git credential-manager install
请在下面找到Windows的工作解决方案:
从“开始”菜单打开“控制面板”。 选择用户帐户。 选择“凭据管理器”。 点击“管理Windows凭证”。 删除所有与Git或GitHub相关的凭证。 一旦你删除了所有,然后尝试再次克隆。
您可能正在尝试推送到私有存储库。在这种情况下,您必须请求管理员验证Collaborator访问。