gpt4 book ai didi

git - 在 Gitconfig 中设置 GIT_SSH 环境变量

转载 作者:IT王子 更新时间:2023-10-29 00:37:57 24 4
gpt4 key购买 nike

有没有办法在gitconfig文件中设置GIT_SSH环境变量?

最佳答案

my 2013 answer (Git 1.8.3.4),设置了一个新配置:core.sshCommand

If this variable is set, git fetch and git push will use the specified command instead of ssh when they need to connect to a remote system.
The command is in the same form as the GIT_SSH_COMMAND environment variable and is overridden when the environment variable is set.

已在Git 2.10, commit 3c8ede3, June 2016中介绍过

从那以后,你有Git 2.13, commit dd33e077, Feb. 2017 , 其中有 ssh.variant

Depending on the value of the environment variables GIT_SSH or GIT_SSH_COMMAND, or the config setting core.sshCommand, Git auto-detects whether to adjust its command-line parameters for use with plink or tortoiseplink, as opposed to the default (OpenSSH).

The config variable ssh.variant can be set to override this auto-detection; valid values are ssh, plink, putty or tortoiseplink.
Any other value will be treated as normal ssh. This setting can be overridden via the environment variable GIT_SSH_VARIANT.


For those, I need to use the SSH client that Git for Windows came with

因此,对于需要 ssh 而不是 putty 的存储库,您可以使用这两个设置在您的配置中完全设置您想要的内容。

 cd /path/to/my/repo
git config ssh.variant ssh

关于git - 在 Gitconfig 中设置 GIT_SSH 环境变量,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18047652/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com