cro*_*smr 5 git gitlab gitkraken
从 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 上收到:
$ ssh -T git@gitlab.com
Enter passphrase for key '/c/Users/crossmr/.ssh/id_rsa':
Welcome to GitLab, @crossmr!
Run Code Online (Sandbox Code Playgroud)
但是,当我现在尝试使用 GitKraken 推送时,GitKraken 告诉我:“配置的 SSH 密钥格式无效”。
然而 bash 界面完全没有问题
编辑 2:GUI 错误图像
这是当前的 GUI 错误,而通过 bash 推送给了我:
$ git push Gitlab master
Enter passphrase for key '/c/Users/crossmr/.ssh/id_rsa':
Uploading LFS objects: 100% (18/18), 38 MB | 1.4 MB/s, done
Enumerating objects: 99, done.
Counting objects: 100% (99/99), done.
Delta compression using up to 4 threads.
Compressing objects: 100% (72/72), done.
Writing objects: 100% (72/72), 7.07 KiB | 452.00 KiB/s, done.
Total 72 (delta 38), reused 0 (delta 0)
To gitlab.com:crossmr/repo.git
4ccee92..d32d232 master -> master
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
319 次 |
| 最近记录: |