配置 Git 以使用 Plink
我正在尝试配置 Git 以使用 Plink。它以前对我有用过很多次。现在,由于某种原因,此选项对我不可用(已禁用):
I尝试卸载并重新安装 Git 一百次。没有什么。我无法启用此选项。
I'm trying to configure Git to use Plink. It worked for me many times before. Now, for some reason, this option isn't available to me (it is disabled):
I tried uninstalling and reinstalling Git a hundred times. Nothing. I can't get to this option enabled.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(6)
我刚刚遇到了这个问题(使用较新版本的 Git,1.7.9)。我使用了 VonC 的答案,但只需要几个步骤:
GIT_SSH
设置为plink.exe
的位置pageant.exe< /code> 并加载您的私钥
在 64 位 Windows 上,plink 的默认位置是
C:\Program Files (x86)\GitExtensions\PuTTY\plink.exe
路径中的空格似乎不再是问题。
I just had this problem (with a newer version of Git, 1.7.9). I used the answer from VonC, but only a couple of steps were needed:
GIT_SSH
to the location ofplink.exe
pageant.exe
and load your private keyOn 64 bit Windows, the default location for plink is
C:\Program Files (x86)\GitExtensions\PuTTY\plink.exe
The spaces in the path no longer seem to be a problem.
这是一个老问题,我也有同样的问题,只是为了确保我会写下对我有用的解决方案。
msysgit 安装程序没有显示允许在 openssh 客户端和 Tortoise 之间进行选择的屏幕 (plink)
解决方案是安装 Putty(或者我猜是 Tortoise Plink),创建并保存至少一个会话,仅安装 Putty 不起作用,必须创建会话,安装程序会对此进行一些奇怪的检查.
当您再次运行 Git 安装程序时,应该会出现该屏幕。
This is an old question, and I just have the same problem, just to be sure I will write down the solution that worked for me.
The msysgit installer didn't show the screen that allows to select between the openssh client and the Tortoise (plink)
The solution is to install Putty (or Tortoise Plink I guess), create and save at least one session, just installing Putty didn't work, the session must be created, the installer does some weird check about that.
When you run the Git installer again, the screen should appear.
这看起来像问题 368:
有一个解决方法(问题 367)
即使有了这个过程,也不容易:
关于空格,如 user2428118 在 评论,您可以使用 8.3 路径:那里不需要空间:
Janusz Skonieczny 添加在评论中:
2017 年 3 月更新,对于 Git 2.13(2017 年第 2 季度)
Git 现在会自动检测您需要的 ssh(OpenSSH 或 plink),但您可以使用
ss.variant.
请参阅提交 dd33e07(2017 年 2 月 1 日)和 提交 e9d9a8a(2017 年 1 月 2 日),作者:Segev Finer (
segevfiner
)。请参阅 提交 e2824e4(2017 年 2 月 1 日),作者:Johannes Schindelin (
dscho
)。请参阅 提交 6a4f3a9(2017 年 1 月 26 日),作者:Junio C Hamano (
gitster
)。(由 Junio C Hamano --
gitster
-- 合并于 提交 be6ab59,2017 年 2 月 27 日)This looks like issue 368:
This has a workaround (issue 367)
Even with that process, it is not easy:
Regarding spaces, as noted by user2428118 in the comments, you can use an 8.3 path: no space needed there:
Janusz Skonieczny adds in the comments:
Update March 2017, for Git 2.13 (Q2 2017)
Git now auto-detects the ssh you need (OpenSSH or plink), but you can force that detection with
ss.variant
.See commit dd33e07 (01 Feb 2017), and commit e9d9a8a (02 Jan 2017) by Segev Finer (
segevfiner
).See commit e2824e4 (01 Feb 2017) by Johannes Schindelin (
dscho
).See commit 6a4f3a9 (26 Jan 2017) by Junio C Hamano (
gitster
).(Merged by Junio C Hamano --
gitster
-- in commit be6ab59, 27 Feb 2017)如果您使用TortoiseGit,您可以永久配置其plink。当然,请在您的计算机上使用正确的路径。
If you are using TortoiseGit, you can permanently configure its plink. Of course use correct path on your machine.
我多年来一直使用带有
GIT_SSH
环境变量的解决方案,但今年的某个时候它停止工作(在更新 git bash 或 putty 工具包之后)。我找到了当前的工作灵魂。首先,您的选美比赛必须正在进行。其次,您必须启动 ssh 代理,但 Windows 代理:它相当于 Windows 用户所知道的:
要添加密钥,您可以使用 ssh-add 或 Pagenant UI 窗口。
I used for many years the solution with
GIT_SSH
environment variable, but sometime this year it stopped working (after update of git bash or putty toolkit). I've found current working soultion. First, your pageant must be running. Second you must start ssh agent, but the windows one:It is windows equivalent of what unix users know:
To add keys you can use
ssh-add
or Pagenant UI window.这就是我于 2023 年 1 月在我的计算机 (Windows 10 Pro x64) 上修复它的方法。1
& 2)配置TortoiseGit(在其设置中...网络>> SSH>> SSH客户端)和Git(GIT_SSH环境变量)以同时使用
C:\Program Files\PuTTY\plink.exe
不带引号。
3& 4) 将 Pageant 和 ssh-add 代理设置为自动启动(我使用了 ssh 代理脚本
https:// docs.github.com/en/authentication/connecting-to-github-with-ssh/working-with-ssh-key-passphrases
并使用我的私钥。
This is what I did to fix it on my machine (Windows 10 Pro x64) in January 2023.
1 & 2) Configured TortoiseGit (in its settings... Network >> SSH >> SSH client) and Git (the GIT_SSH environment variable) to both use
C:\Program Files\PuTTY\plink.exe
without quotation marks.
3 & 4) Set up both Pageant and ssh-add agent to auto-start (I used the ssh agent script from
https://docs.github.com/en/authentication/connecting-to-github-with-ssh/working-with-ssh-key-passphrases
and use my private key.