Skip to content

Instantly share code, notes, and snippets.

@mikeslattery
Forked from JanTvrdik/.bashrc
Created March 6, 2019 16:36
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 mikeslattery/4571074a2c0fc3491ac541a59fde10de to your computer and use it in GitHub Desktop.
Save mikeslattery/4571074a2c0fc3491ac541a59fde10de to your computer and use it in GitHub Desktop.
ssh-agent support for Git Bash / MinGW / msys / Windows
# put this in ~/.bashrc
export SSH_AUTH_SOCK=/tmp/.ssh-socket
ssh-add -l > /dev/null
if [ $? = 2 ]; then
rm -f $SSH_AUTH_SOCK
echo Starting new ssh-agent...
eval $(ssh-agent -a $SSH_AUTH_SOCK) > /dev/null
ssh-add && echo "ssh-agent set up successfully with the following keys:" && ssh-add -l
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment