I am trying to clone a Git repo using a custom SSH command. I set the SSH command in the GIT_SSH environmental variably be running
export GIT_SSH="/usr/bin/ssh -o StrictHostKeyChecking=no -i /home/me/my_private_key".
But when, after the previous command I run
git clone git@bitbucket.org:uname/test-git-repo.git, I get the following weird error
error: cannot run /usr/bin/ssh -o StrictHostKeyChecking=no -i /home/me/my_private_key
fatal: unable to fork
Can you please help me out solve this issue?
You cannot provide options in the
GIT_SSHenvironment variable; from thegitman page:One option is to add a stanza to your
.ssh/configfile with the appropriate configuration:Another option is to point
GIT_SSHto a shell script that does what you want. E.g., in/home/me/bin/bitbucket_ssh, put:And then point
GIT_SSHat/home/me/bin/bitbucket_ssh.I prefer using
.ssh/configwhen possible, because this avoids the need to create a per-destination script for each remote.