Created
June 21, 2018 04:45
-
-
Save frankzhao/e55679c3f006fee1714534bc59621ad0 to your computer and use it in GitHub Desktop.
Enable ssh-agent for Git bash on windows
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Add your ssh key to ~/.ssh/id_rsa | |
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