[英]How can I use Windows' built-in OpenSSH ssh-agent in VS Code, instead of Git bash's?
[英]On Windows 10 that is well configured with native OpenSSH's ssh-agent, how to have an implementation of git use the ssh-agent configured?
我已經像這里描述的那樣配置了本機 Windows 10 OpenSSH: https : //www.makeuseof.com/tag/windows-10-ssh-vs-putty/
此外,我已作為服務 ssh-agent 啟動,添加了私鑰,並且在重新啟動之間記住了我的私鑰密碼。
所以主要是,我可以在沒有提示的情況下重新啟動后立即執行以下操作: ssh -T git@gitlab.com
但是,我不知道如何獲得“git”的任何實現以將 ssh 工作委派給 Windows 本機 ssh-agent,以便我可以在沒有任何提示的情況下執行克隆,例如: git clone git@gitlab.com:SandboxAtHoopSoft/create-aws-accounts.git
找到的解決方法是:
設置操作系統環境變量:
set GIT_SSH=C:\\WINDOWS\\System32\\OpenSSH\\ssh.exe
或者
設置git配置:
git config --global core.sshCommand "'C:\\Windows\\System32\\OpenSSH\\ssh.exe'"
剛剛自己解決了這個問題,這是一個非常令人沮喪的旅程,但對我來說,以下內容讓我繼續前進:
C:\\Windows\\System32\\OpenSSH\\
在你的路徑變量中(是的,我知道 Windows 應該自己看到這個)C:\\Users\\<your user>\\.gitconfig
編輯您的全局 git 配置文件以指向正確的ssh.exe
: C:/Windows/System32/OpenSSH
id_rsa.ppk
文件位於C:\\Users\\<your user>\\.ssh
如果您還沒有 SSH 密鑰,請生成一個並確保它最終位於此文件夾中
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.