When I want to use a specific private key file for a single git operation, apparently I have to change the GIT_SSH environment variable. However, I cannot just set it to
C:\Program Files\TortoiseGit\bin\TortoisePlink.exe -i D:\repo\key
.
The manpage confirms this:
To pass options to the program that you want to list in GIT_SSH you will need to wrap the program and options into a shell script, then set GIT_SSH to refer to the shell script.
So, how do I do this? What is a "shell script" in this case? A batch file? A file with #!bash
? Neither way works, both give me:
error: cannot spawn "D:\repo\test.bat": No such file or directory
fatal: unable to fork
With the .sh file I get the same error, just with a different filename of course. There is a bash in msysgit and it is in my PATH, but git does not seem to understand the shebang. I also tried to convert the path to an msys-style path (/d/repo/test.sh
), but git still says "No such file or directory". When I run bash
and paste the exact same path, it is executed.