set sshagent in windows
Always follow this page with success. page
Enable the ssh-agent service on your Windows 10 box.
- Start-> Type ‘Services’ and click on the Services App that appears.
- Find the OpenSSH Authentication Agent service in the list.
- Right-click on the OpenSSH Authentication Agent service, and choose ‘Properties’.
- Change the Startup type: to Automatic.
- Click the Start button to change the service status to Running.
- Dismiss the dialog by clicking OK, and close the Services app.
Add your key to the ssh-agent
- Open your shell of preference (I’ll use Windows Powershell in this example, applies to Powershell Core too).
- Add your SSH key to the ssh-agent: ssh-add (you can add the path to your key as the first argument if it differs from the default).
- Enter your passphrase if/when prompted to do so.
but sometime unlucky ,it still ask passpharases
so we need follow this answer
To set GIT_SSH permanently
- Open File Explorer. Start-> type ‘File Explorer’ and click on it in the list.
- Right-click ‘This PC’ and click on ‘Properties’.
- Click on ‘Advanced system settings’.
- Click the ‘Environment Variables…’ button.
- Under ‘User variables for your_user_name’ click New…
- Set Variable name: field to GIT_SSH
- Set the Variable value: field to path-to-ssh.exe (typically C:\Windows\System32\OpenSSH\ssh.exe).
- Click OK to dismiss the New User Variable dialog.
- Click OK to dismiss the Environment Variables dialog.
- Retry the steps in Try Git + SSH above.