Skip to content

Instantly share code, notes, and snippets.

@avisagie
Created August 4, 2018 10:08
Show Gist options
  • Save avisagie/9f9d92c561f150a52e9ad12a97df5dbe to your computer and use it in GitHub Desktop.
Save avisagie/9f9d92c561f150a52e9ad12a97df5dbe to your computer and use it in GitHub Desktop.
Add this to your ~/.bashrc under git bash for Windows to get ssh-agent working fairly smoothly. It only starts one ssh-agent and you only need to type your private key password once.
if ps | grep ssh-agent &> /dev/null
then
. ~/.ssh-agent
else
ssh-agent > ~/.ssh-agent
. ~/.ssh-agent
ssh-add
fi
@avisagie
Copy link
Author

avisagie commented May 5, 2019

Assuming you encrypted your private key in the first place. As you do, right?
If not, do this:
ssh-keygen -o -p -f ~/.ssh/id-rsa

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