Skip to content

Instantly share code, notes, and snippets.

@jbbarth
Created September 6, 2016 16:06
Show Gist options
  • Save jbbarth/e78bfb6d81f475d0d53ac6c50e0c634f to your computer and use it in GitHub Desktop.
Save jbbarth/e78bfb6d81f475d0d53ac6c50e0c634f to your computer and use it in GitHub Desktop.
#!/bin/bash
if [ "$1" == "clone" ]; then
repo=$(echo $3|sed 's#.*/##')
key="$HOME/.ssh/id_rsa_$repo"
if [ -e "$key" ]; then
export GIT_SSH="ssh -i $key -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no"
fi
fi
git $*
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment