Skip to content

Instantly share code, notes, and snippets.

@colonelpopcorn
Created November 29, 2016 13:47
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 colonelpopcorn/f77465fb624c4156e96ce9d85c12aade to your computer and use it in GitHub Desktop.
Save colonelpopcorn/f77465fb624c4156e96ce9d85c12aade to your computer and use it in GitHub Desktop.
Loops through an array of paths to ssh keys and adds them to the agent in a git bash for windows session. Still requires passwords.
#declares an array of keys to loop through and add to the ssh-agent, run before a git bash session on windwows.
#bin/sh
declare -a keys=("/c/users/jonathan/path/to/key" "/c/users/jonathan/path/to/other/key")
eval $(ssh-agent -s)
for i in "${keys[@]}"; do
ssh-add "$i"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment