17

I'm new to using git. Each time I want to push my file to github, it's always show me notification to enter my passphrase. Ex: Enter passphrase for key '/c/Users/.ssh/id_rsa':

I want my git remember the passphrase for me. How should I possibly do that on windows 7? I've already read the help page here http://help.github.com/ssh-key-passphrases/. It seems only available for Mac / Linux.

Thanks for helping.

coffee-grinder
  • 26,940
  • 19
  • 56
  • 82
  • What are you using for SSH? If Putty, it includes pageant, which you can use as a key agent in windows. Then you would need to set up the GIT_SSH environment variable. – Pablo Maurin Dec 15 '11 at 10:31
  • Possible duplicate of [Remember Password, Git bash under windows](http://stackoverflow.com/questions/5727555/remember-password-git-bash-under-windows) – Michael Freidgeim Nov 19 '16 at 05:09

3 Answers3

13

I believe if you use msysgit then you can install (or maybe it comes already installed) openssh.

With openssh you can use the command line program ssh-add to add you key once and remember it:

ssh-add /c/Users/.ssh/id_rsa
holygeek
  • 15,653
  • 1
  • 40
  • 50
6

After spending ample time on going through many articles and stackoverflow answers I found following approach working out for me for Windows.

  1. Enable the OpenSSH Authentication Agent service and make it start automatically. Refer this article
  2. Add your SSH key to the agent with ssh-add
  3. Add an environment variable for GIT_SSH - setx GIT_SSH C:\Windows\System32\OpenSSH\ssh.exe
  4. Config git - git config --global core.sshCommand C:/Windows/System32/OpenSSH/ssh.exe

4th step was the gem for me ;)

Shanika Ediriweera
  • 1,975
  • 2
  • 24
  • 31
0

One of these questions surely contains valid answers: How to push with git to github on Windows?

How do I store a password for my key so I can commit and pull from repository when using git on windows?

Or you could use putty like they do in this answer

Community
  • 1
  • 1
jpjacobs
  • 9,359
  • 36
  • 45