【发布时间】:2026-02-24 17:10:01
【问题描述】:
我的 VSCode 在使用 Golang 及其在 GitHub 上的更新时遇到了困难。在控制台上,我可以正常使用Git,我还使用go 命令来构建和运行我的go 应用程序,一切正常。但是,当我使用VSCode 时,它根本无法像控制台一样通过SSH 进行身份验证。
完整的信息是:
Error loading workspace: err: exit status 1: stderr: go: github.com/abc/abc@v0.0.0-20210610172953-593247e413d4:
invalid version: git fetch -f origin refs/heads/*:refs/heads/* refs/tags/*:refs/tags/* in
D:\Program Files\Go\bin\pkg\mod\cache\vcs\1c3dbe9a49296bf60aa851731c66574793ff0c41b2a50ff727de076b8a8fce2d: exit status 128:
Permission denied (publickey). fatal: Could not read from remote repository.
Please make sure you have the correct access rights and the repository exists. : packages.Load error
有人知道怎么解决吗?
【问题讨论】:
-
哪一个?在已激活 ssh-agent 的环境中启动 VSCode? (仅当您的私钥受密码保护时才需要)
-
@VonC 是的,这确实对我有用。
-
好的。我已经相应地编辑了答案。
标签: git go visual-studio-code