Skip to content

Instantly share code, notes, and snippets.

@wanabe
Created July 9, 2015 07:59
Show Gist options
  • Select an option

  • Save wanabe/5a4b8783910e557cd832 to your computer and use it in GitHub Desktop.

Select an option

Save wanabe/5a4b8783910e557cd832 to your computer and use it in GitHub Desktop.
git with ssh private key
#!/bin/sh
if [ -n "$GIT_SSH" ]; then
echo ssh $GIT_SSH_OPT $* 1>&2
ssh $GIT_SSH_OPT $*
else
export GIT_SSH_OPT="-i $1"
export GIT_SSH=$0
shift
echo git "$*"
exec git $*
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment