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

我打开终端使git按-f

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

我不确定会有什么问题。


当前回答

这可能是一个重叠的问题,你在同一时间配置不同的帐户。

试着检查:

git config user.name git config user.email

检查是否与远程回购相同。

查看repo git remote -v

其他回答

从系统中删除所有github.com凭据详细信息。

对于mac

从Keychain Access中删除github.com密码。

对于windows

从凭证管理器中删除凭证。

在Mac

如果您正在尝试克隆repo....然后这个问题可能会发生,因为你没有回购目前在github帐户目前在钥匙串访问。为了解决这个问题,请尝试使用帐户名进行克隆

Git 克隆 https://username@github.com/org/repo.git

取代

用户名与你的GitHub用户名 与您的组织名称 使用存储库名称进行回购

有时ssh凭证是安装在你的电脑上与github回购通信。 当你设置新的repo:如果你添加了https格式的origin,你的git凭证管理器不能找出repo。

检查产地格式

git remote -v

https格式的来源

origin  https://github.com/username/repo_name.git

ssh格式的原点

origin git@github.com:username/repo_name.git

删除https格式的origin

git remote remove origin

添加ssh格式的origin

git remote add origin git@github.com:username/repo_name.git

您必须生成一个新的令牌:这里的步骤是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

并删除<>字符

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