V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX 提问指南
proxytoworld
V2EX  ›  问与答

为什么在 vscode 的 wsl terminal 可以成功 git push,在 wt 中登录 wsl git push 却要身份验证(已经在 github 配置了证书)

  •  
  •   proxytoworld · 2022-09-19 09:46:41 +08:00 · 880 次点击
    这是一个创建于 586 天前的主题,其中的信息可能已经有所发展或是发生改变。

    如题,在 vscode 的 wsl terminal 可以成功 giut push ,wt 用 wsl -u user 却不能 git push

    用 git config --list --show-origin 展示的 config 都一样

    难道 vscode 注入了一些变量?

    9 条回复    2022-09-20 08:38:57 +08:00
    liubaicai
        1
    liubaicai  
       2022-09-19 09:53:37 +08:00
    wt 是什么
    proxytoworld
        2
    proxytoworld  
    OP
       2022-09-19 10:35:36 +08:00
    @liubaicai windows terminal
    villivateur
        3
    villivateur  
       2022-09-19 10:36:39 +08:00   ❤️ 1
    你看下是不是因为你用了 https 协议来 push 代码。另外在 GitHub 配置证书是啥意思?是公钥吗? https 是不能用 ssh 的密钥对的。
    dem0ns
        4
    dem0ns  
       2022-09-19 10:42:54 +08:00
    windows 的私钥和 wsl 的私钥位置不一样

    C:\Users\xxx\.ssh\
    ~/.ssh/
    proxytoworld
        5
    proxytoworld  
    OP
       2022-09-19 10:43:36 +08:00
    @villivateur 都是 git push ,在 vscode 和 wt 里面走的不是同一个协议吗
    dem0ns
        6
    dem0ns  
       2022-09-19 10:45:00 +08:00
    而且你这用的是 https ,是用的密码认证
    proxytoworld
        7
    proxytoworld  
    OP
       2022-09-19 10:48:29 +08:00
    @dem0ns 都在 wsl 里面
    cweijan
        9
    cweijan  
       2022-09-20 08:38:57 +08:00
    哥们, 你用的是 https, 就是需要输入密码的, 你用 vscode 不用密码是因为凭据被记住了, 你试下在 wsl 里面配置
    `git config --global credential.helper store`
    输入密码一次后应该就不用再输入的, 和你配不配置证书没关系.
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   1794 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 27ms · UTC 16:22 · PVG 00:22 · LAX 09:22 · JFK 12:22
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.