4

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

2 Answers 2

5

1) Create a .bashrc file in the user directory (default windows C:\Users\UserName\)
NOTES: if you think you can just right click in the directory in Windows Explorer and create a file called .bashrc you (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 executing echo 'blah' >> .bashrc just so I could get the file to edit in notepad to put the required code in it.

2) Edit .bashrc in 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: ps will 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 executed ps I 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.

Sign up to request clarification or add additional context in comments.

3 Comments

I've used the PuTTY family of tools before and they have worked great. However, I've seen some negative feedback in the msysgit forum. People saying it should be removed from the installer as an option. I've researched why there would be that kind of buzz because it seamed to be a great option on a VM that I was using before. Just wanted to post this if someone wanted to use the built in ssh-agent as opposed to the PuTTY toolset
Good call on killing ssh-agent! I was having trouble until I killed all ssh-agent processes and restarted.
It's a little late in the game for this, but if you name a file .bashrc. in Windows (at least 7+), Windows will give you a .bashrc file.
-4

What about to include pass in git repo-url:

git clone http://username:[email protected]/git/Project.git .

It's not very safe solution, but works :)

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.