Skip to content

Instantly share code, notes, and snippets.

@Tantalus13A98B5F
Created January 6, 2020 04:21
Show Gist options
  • Save Tantalus13A98B5F/bc86788b0a9c9df659bfc4947ca76e8b to your computer and use it in GitHub Desktop.
Save Tantalus13A98B5F/bc86788b0a9c9df659bfc4947ca76e8b to your computer and use it in GitHub Desktop.
My Git Bash agent starting script. Setting system variables so useful to work with graphical git tools.
#!/bin/bash
agent_run_state=$(ssh-add -l >| /dev/null 2>&1; echo $?)
if [ "$agent_run_state" = 2 ]; then
rm -rf /tmp/ssh-*
eval $(ssh-agent -s)
winpty setx SSH_AUTH_SOCK $SSH_AUTH_SOCK
winpty setx SSH_AGENT_PID $SSH_AGENT_PID
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment