Git-远程:未找到存储库
我有本地工作副本的SourceTree。所有操作都很好,我可以通过SourceTree简单地获取、推送、拉取等。我只需要进行SourceTree中不存在的强制推送 我打开了git push-f的终端Git-远程:未找到存储库,git,github,atlassian-sourcetree,Git,Github,Atlassian Sourcetree,我有本地工作副本的SourceTree。所有操作都很好,我可以通过SourceTree简单地获取、推送、拉取等。我只需要进行SourceTree中不存在的强制推送 我打开了git push-f的终端 remote: Repository not found. fatal: repository 'https://github.com/MyRepo/project.git/' not found 我不确定是什么问题。因为您可能没有首先在终端上标识远程git存储库 git remote set-u
remote: Repository not found.
fatal: repository 'https://github.com/MyRepo/project.git/' not found
我不确定是什么问题。因为您可能没有首先在终端上标识远程git存储库
git remote set-url origin https://github.com/MyRepo/project.git
然后呢,
git add .
git commit -m "force push"
git push origin master --force
这可能是身份验证的问题。SourceTree缓存您的github凭据(用于通过https访问存储库),但从终端,您必须使用凭据()配置git,或者使用git+ssh和ssh密钥对()。找到存储库时可能会出现此消息,但我们没有提交访问权限。措辞不好
在克隆了老板为我创建的gitHub存储库后,我收到了repo not found消息。我可以在本地克隆和提交,但不能将提交推到上游。存储库所有者没有授予我写权限。通过请求对回购所有人进行写访问解决 您可能正在尝试推送到私有存储库。在这种情况下,您必须要求管理员对协作者访问权限进行身份验证。我也面临同样的问题
remote: Repository not found
fatal: repository 'https://github.com/MyRepo/project.git/' not found
我卸载了git credentials manager并重新安装了它,然后我可以轻松地拉入并推送到存储库。以下是命令
$ git credential-manager uninstall
$ git credential-manager install
这里的问题是windows凭据管理器,请转到控制面板,搜索凭据管理器并删除其中有关github的所有内容,因此您的url当前如下所示 它需要看起来像这样
区别在于我在url的开头添加了我的github用户名,后跟@符号 我通过删除
.git
文件(隐藏文件夹),然后再次上传解决了这个问题。在我的情况下,上面的解决方案都不起作用
我通过将remote.origin.url
从https切换到ssh解决了这个问题:
验证git配置:
git config --list
应该是:
...
remote.origin.url=https://github.com/ORG/repo-name.git
...
使用ssh更新remote.origin.url
:
git remote set-url origin git@github.com:ORG/repo-name.git
从系统中删除所有github.com凭据详细信息 适用于mac 从密钥链访问中删除github.com密码 用于窗口
从凭据管理器中删除凭据。我遇到了相同的问题,并发现我在
~/.ssh
中有另一个密钥文件,用于不同的GitHub存储库。不知怎的,它被用来代替了新的。这里的问题是本地git无法将更改推送到远程
检查您的遥控器是否设置正确
git remote -v
如果设置不正确,请尝试将遥控器设置为
git remote set-url origin https://username@github.com/MyRepo/project.git
然后尝试使用
git push -u origin master
另外,您的本地git可能有不同的凭据,请检查。在我的回购上设置2FA后,我也遇到了同样的问题。如果您最近在您的帐户上设置了2FA,以下是我为解决此问题所做的: 生成个人访问令牌 转到GitHub帐户上的设置->开发人员设置->个人访问令牌。生成新的个人访问令牌。确保检查所有与回购访问相关的权限 删除所有GitHub身份验证配置(从Mac的密钥链) 您需要使用生成的个人访问令牌重新登录,以便从笔记本电脑中清除所有以前的身份验证详细信息。对于mac,打开keychain并从登录/密码部分删除所有github.com相关详细信息 使用GitHub用户名和PAT作为密码登录到您的终端。 如果您已在帐户上设置2FA,则无法使用 来自终端的GitHub密码。现在,尝试推送到GitHub repo以触发身份验证需求。输入GitHub用户名的请求将在终端上弹出。输入用户名,当提示输入密码时,使用生成的个人访问令牌作为密码
这些确切的步骤为我解决了问题。请在下面找到Windows的工作解决方案:
在我的情况下,由于用户错误,我无法克隆github 转到
~/.gitconfig
然后尝试删除这行代码(只需删除它,然后保存文件)
或者尝试在cmd或terminal中使用一行代码:git config--global--remove section user
并尝试再次进行git克隆。希望它能帮你度过美好的一天。>- 如果您没有写入权限,但只有读取权限,则可能发生这种情况
- 如果它是一个私有存储库,您应该被添加为合作者
- 检查您的凭证是否正确
祝你好运。对于Mac来说 打开KeyChain Access并在密码类别中查找您的pssword帐户(您可以在右上角的KeyChain Access页面中进行搜索) 找到它后,删除与git源代码管理相关的所有键。然后再试一次
禁用GIT凭据帮助我:
git config --global --unset credential.helper
在Mac上 如果您试图克隆回购协议。。。。然后,可能会出现此问题,因为您在密钥链访问中的github帐户中没有回购。要解决此问题,请尝试使用帐户名进行克隆,如
git克隆https://username@github.com/org/repo.git
更换
$ git clone https://github.com/abc/def.git
Cloning into 'def'...
remote: Repository not found.
fatal: repository 'https://github.com/abc/def.git/' not found
- 用户名与您的GitHub用户名
- 使用您的组织名称创建组织<
$ git clone https://github.com/abc/def.git Cloning into 'def'... remote: Repository not found. fatal: repository 'https://github.com/abc/def.git/' not found
abc@DESKTOP-4B77L5B MINGW64 /c/xampp/htdocs $ git credential-manager uninstall abc@DESKTOP-4B77L5B MINGW64 /c/xampp/htdocs $ git credential-manager install
git pull origin master
git add . git commit -m "message" git remote set-url origin https://YOUR_GITHUB_USER@github.com/aceofwings/RotairERP.git
git pull
git remote add origin https://your-username@github.com/your-username/repository-name.git
git remote set-url origin https://your-username@github.com/your-username/respository-name.git
Settings > Developer Settings > Personal Access Tokens > Generate new token