Ok, this is a pretty specific question, but I had some challenges figuring it out so I figured I would share my experience so if anyone else runs into the same problems, they can fix it a little faster.
Goal: use ssh-agent and msysgit to -as securely as possible- store ssh key password to prevent having to type it for every git command involving remote repository
1) Create a
.bashrcfile in the user directory (default windowsC:\Users\UserName\)NOTES: if you think you can just right click in the directory in Windows Explorer and create a file called
.bashrcyou (and me) are sadly mistaken, you’ll get an error from Explorer preventing you from creating a file without a name. So, I did this from my git bash by executingecho 'blah' >> .bashrcjust so I could get the file to edit in notepad to put the required code in it.2) Edit
.bashrcin a text editor and put the code found here: https://help.github.com/articles/working-with-ssh-key-passphrases#platform-windows under “Auto-launching ssh-agent on msysgit”3) restart bash.
TROUBLE SHOOTING:
pswill show all running processes. I found that when I was testing this out, it wasn’t prompting me to put in my password when bash was started. When I executedpsI noticed many ssh-agents running. After killing them all, I was able to restart git bash and everything worked. Identifying this problem took me the longest.