Skip to content

Instantly share code, notes, and snippets.

@tyrcho
Created June 25, 2012 12:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tyrcho/2988248 to your computer and use it in GitHub Desktop.
Save tyrcho/2988248 to your computer and use it in GitHub Desktop.
bash script to use ssh-agent in Windows environment
ssh-add -l >/dev/null 2>&1
if [ $? = 2 ]; then
# exit-status 2 = couldn't connect to ssh-agent
rm $SSH_AUTH_SOCK
echo -n "Starting SSH agent ... "
eval `ssh-agent -a $SSH_AUTH_SOCK`
ssh-add
fi
@tyrcho
Copy link
Author

tyrcho commented Jun 25, 2012

I have defined SSH_AUTH_SOCK=/tmp/.ssh-socket in my environment variables

This works with msysgit and git-svn or github for instance.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment