- 1 year ago
Using TortoisePLink in GIT_SSH_COMMAND: "-batch" switch not respected
When using TortoisePLink as the SSH client in the GIT_SSH_COMMAND
environment variable, the -batch
switch may not be respected because TortoisePLink does not directly support that option.
The -batch
switch is commonly used with OpenSSH's ssh
command to prevent it from displaying any interactive prompts or requiring user input. However, TortoisePLink, which is a component of TortoiseGit, does not have a direct equivalent to the -batch
switch.
If you need to suppress any interactive prompts and ensure non-interactive behavior when using TortoisePLink, you may consider using an alternative SSH client that supports the -batch
switch. For example, you can use OpenSSH's ssh
client by installing it separately and configuring Git to use it as the SSH client.
To configure Git to use OpenSSH's ssh
client, follow these steps:
Install OpenSSH: Download and install OpenSSH for Windows from the official OpenSSH website or from other reliable sources.
Set the
GIT_SSH_COMMAND
environment variable: Open a command prompt and set theGIT_SSH_COMMAND
environment variable to point to the location of thessh
executable from the OpenSSH installation. For example:
bashsetx GIT_SSH_COMMAND "C:\Path\To\OpenSSH\ssh.exe"
Replace "C:\Path\To\OpenSSH\ssh.exe"
with the actual path to the ssh
executable on your system.
- Test the configuration: Restart your Git client or open a new command prompt and run your Git commands. The
-batch
switch should now be respected as it uses OpenSSH'sssh
client instead of TortoisePLink.
By configuring Git to use OpenSSH's ssh
client instead of TortoisePLink, you should be able to achieve the desired behavior with the -batch
switch. Remember to adjust the paths and commands based on your specific installation and configuration.