Created
January 23, 2017 21:19
-
-
Save Mebus/a44fb9f5c12357dbb0a53223c7bafe52 to your computer and use it in GitHub Desktop.
.profile for using the ssh agent with git 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
gent_running() { | |
[ "$SSH_AUTH_SOCK" ] && { ssh-add -l >/dev/null 2>&1 || [ $? -eq 1 ]; } | |
} | |
env=~/.ssh/agent.env | |
if ! agent_running && [ -s "$env" ]; then | |
. "$env" >/dev/null | |
fi | |
if ! agent_running; then | |
ssh-agent >"$env" | |
. "$env" >/dev/null | |
ssh-add | |
fi | |
unset env |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment