I have just start using git and i can't get it to remember my passphrase I'm using cmd.exe elevated and my git host is github and i have create a ssh key like that guide on github
but i still get
*\subnus.mvc>git push origin master
Enter passphrase for key '/c/Users/Subnus/.ssh/id_rsa':
I realize that this question is coming up on two years old, but I had the same issue and several answers here did not completely answer the question for me. Here is two step-by-step solutions, depending on whether you use TortoiseGit in addition to msysgit or not.
First solution Assumes Windows, msysgit, and PuTTY.
Access Windows' environment variables dialog (Right-click on "Computer", Click on "Properties", Click on "Advanced system settings" or the "Advanced" tab, click on "Environment Variables"). Add the following environment variable:
GIT_SSH=C:\full\path\to\plink.exe
Replace "C:\full\path\to" with the full installation path to PuTTY, where plink.exe is found. It is probably best to add it to the "User variables" section. Also, make sure that the path you use to plink.exe matches the path you use for Pageant (pageant.exe). In some cases you may have several installations of PuTTY because it might be installed along with other applications. Using plink.exe from one installation and pageant.exe from another will likely cause you trouble.
Open a command prompt.
If you are trying to connect to a git repository hosted at Github.com then run the following command:
plink.exe [email protected]
If the git repository you are trying to connect to is hosted somewhere else, then replace [email protected] with an appropriate user name and URL. (Assuming Github) You should be informed that the server's host key is not cached, and asked if you trust it. Answer with a y. This will add the server's host key to PuTTY's list of known hosts. Without this step git commands will not work properly. After hitting enter, Github informs you that Github does not provide shell access. That's fine...we don't need it. (If you are connecting to some other host, and it gives you shell access, it is probably best to terminate the link without doing anything else.)
Second solution Assumes Windows, msysgit, and TortoiseGit.
TortoiseGit comes with PuTTY executables, and a specially modified version of plink (called TortoisePlink.exe) that will make things easier.
Access Windows' environment variables dialog (Right-click on "Computer", Click on "Properties", Click on "Advanced system settings" or the "Advanced" tab, click on "Environment Variables"). Add the following environment variable:
GIT_SSH=C:\full\path\to\TortoisePlink.exe
Replace "C:\full\path\to" with the full installation path to TortoiseGit, where TortoisePlink.exe is found. It is probably best to add it to the "User variables" section. Also, make sure that the path you use to TortoisePlink.exe matches the path you use for Pageant (pageant.exe). In some cases you may have several installations of PuTTY because it might be installed along with other applications. Using TortoisePlink.exe from the TortoiseGit installation and pageant.exe from another installation of a different application (or from a standalone PuTTY installation) will likely cause you trouble.
All done! Git commands should now work from the command line. The first time you try to connect to your git repository you will probably be informed that the server's host key is not cached, and asks if you trust the server. Click on "Yes". (This is TortoisePlink.exe in action.)
You may want to have pageant.exe load your .ppk file automatically at boot time, depending on how often you'll be needing it.
Third solution Assumes Window, msysgit, and native command prompt.
start-ssh-agent