Skip to content

Instantly share code, notes, and snippets.

@JamesSwift
Created March 29, 2013 20:14
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 JamesSwift/5273325 to your computer and use it in GitHub Desktop.
Save JamesSwift/5273325 to your computer and use it in GitHub Desktop.
I was having trouble initiating the `ssh-agent` on Git Bash (Git for Windows) in my `.bashrc` file using the example provided at: https://help.github.com/articles/working-with-ssh-key-passphrases So I created a simple script that does the job. It initiates a ssh-agent when you open Git Bash, and kills it when you close the bash. Note, it doesn't…
#! /bin/bash
#Start ssh-agent
eval `ssh-agent`
#Uncomment the next line if you want to automatically load ssh-keys at startup
#ssh-add
#Kill ssh-agent when we close the shell
trap "ssh-agent -k" EXIT
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment