小编cro*_*smr的帖子

无法推送到克隆的回购

从 Github 迁移到 Gitlab。克隆 repo,设置我的密钥等。我正在使用 GitKraken(之前使用过 sourcetree,但已切换)。

问题:在一个存储库上推送 Gitlab 尝试失败,并显示“git@gitlab.com: Permission denied (publickey)”。

我在 GitKraken 中创建了一个新的存储库,将其设置为私有,并且能够通过 ssh 推送多个提交而不会通过 GitKraken 推送到 Gitlab。这告诉我密钥或类似的东西没有实际问题,而且这个错误有点误导。两个 Repos 的设置相同,都是私有的,使用 SSH 并启用 LFS。

当我推送到我从 github 克隆的 repo 时,它抛出了这个错误,告诉我一定有某种配置问题或其他什么,但我在这方面有点新手,不知道去哪里检查重置这种东西。

编辑:我在两个存储库上都运行了 ssh -vT git@gitlab.com。两者都以:

debug1: Authentications that can continue: publickey
debug1: Trying private key: /c/Users/crossmr/.ssh/id_dsa
debug1: Trying private key: /c/Users/crossmr/.ssh/id_ecdsa
debug1: Trying private key: /c/Users/crossmr/.ssh/id_ed25519
debug1: Trying private key: /c/Users/crossmr/.ssh/id_xmss
debug1: No more authentication methods to try.
git@gitlab.com: Permission denied (publickey).
Run Code Online (Sandbox Code Playgroud)

然而,我通过 gitkraken 创建的 repo 也返回完全相同的输出,我可以很好地推送到它。

出于测试目的,我生成了一组全新的密钥,现在在 bash 上收到: …

git gitlab gitkraken

5
推荐指数
0
解决办法
319
查看次数

标签 统计

git ×1

gitkraken ×1

gitlab ×1