金庆的专栏

  C++博客 :: 首页 :: 新随笔 :: 联系 :: 聚合  :: 管理 ::
  422 随笔 :: 0 文章 :: 454 评论 :: 0 Trackbacks

TortoiseGit is OK but GitExtensions fails

GitExtensions and Git fail:

      "git" pull --progress "origin"
git@github.com: Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
Done
Press Enter or Esc to exit...

    

But TortoiseGit is OK.

      git.exe pull --progress -v --no-rebase "origin"
From github.com:jinq0123/recastnavigation
= [up to date]      master      -> origin/master
= [up to date]      release-2.0 -> origin/release-2.0
Already up to date.

    

ssh -T shows that the reason is there is no id files:

      PS d:\github> ssh -vT git@github.com
OpenSSH_for_Windows
debug1: Connecting to github.com [20.205.243.166] port 22.
debug1: Connection established.
debug1: identity file C:\\Users\\jinqing/.ssh/id_rsa type -1
debug1: identity file C:\\Users\\jinqing/.ssh/id_xmss-cert type -1
debug1: Authenticating to github.com:22 as 'git'
debug1: Host 'github.com' is known and matches the ED25519 host key.
debug1: Found key in C:\\Users\\jinqing/.ssh/known_hosts:2
debug1: Will attempt key: C:\\Users\\jinqing/.ssh/id_rsa
debug1: Will attempt key: C:\\Users\\jinqing/.ssh/id_xmss
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey
debug1: Next authentication method: publickey
debug1: Trying private key: C:\\Users\\jinqing/.ssh/id_rsa
debug1: Trying private key: C:\\Users\\jinqing/.ssh/id_xmss
debug1: No more authentication methods to try.
git@github.com: Permission denied (publickey).
PS d:\github>

    

Copy my RSA key file rsa.ppk that TortoiseGit uses as ~/.ssh/id_rsa:

      PS D:\jinqing\github_jinq\recastnavigation> ssh -T git@github.com
Load key "C:\\Users\\jinqing/.ssh/id_rsa": invalid format
git@github.com: Permission denied (publickey).
PS D:\jinqing\github_jinq\recastnavigation>

    

Open TortoiseGit/bin/puttygen.exe, load rsa.ppk, then Convensionis->Export OpenSSH key as ~/.ssh/id_rsa:

      PS D:\jinqing\github_jinq\recastnavigation> ssh -T git@github.com
Hi jinq0123! You've successfully authenticated, ...

    

id_rsa begins with:

      -----BEGIN RSA PRIVATE KEY-----

    
posted on 2022-04-24 14:01 金庆 阅读(72) 评论(0)  编辑 收藏 引用 所属分类: 5. 软工与管理9. 其它

只有注册用户登录后才能发表评论。
【推荐】超50万行VC++源码: 大型组态工控、电力仿真CAD与GIS源码库
网站导航: 博客园   IT新闻   BlogJava   知识库   博问   管理