<t>2013: In a git bash session, you can add a script to ~/.profile or ~/.bashrc (with ~ being usually set to %USERPROFILE%), in order for said session to launch automatically the ssh-agent.<br/>
<br/>
If the file doesn't exist, just create it.<br/>
<br/>
This is what GitHub describes in "Working with SSH key passphrases".<br/>
<br/>
The "Auto-launching ssh-agent on Git for Windows" section of that article has a robust script that checks if the agent is running or not.<br/>
<br/>
Below is just a snippet, see the GitHub article for the full solution.<br/>
<br/>
# This is just a snippet. See the article above.<br/>
if ! agent_is_running; then<br/>
agent_start<br/>
ssh-add<br/>
elif ! agent_has_keys; then<br/>
ssh-add<br/>
fi<br/>
<br/>
```<br/><br/>
Other Resources:<br/>
<br/>
"[Getting ssh-agent to work with git run from windows command shell](https://stackoverflow.com/a/15870387/6309)" has a similar script, but I'd refer to the GitHub article above primarily, which is more robust and up to date.<br/>
<br/>
[hardsetting](https://stackoverflow.com/users/2779525/hardsetting) adds in [the comments](https://stackoverflow.com/questions/18404272/running-ssh-agent-when-starting-git-bash-on-windows/18404557#comment94476040_18404557) (2018):<br/>
<br/>
If you want to enter the passphrase the first time you need it, and not when opening a shell, the cleanest way to me is:<br/>
<br/>
- removing thessh-addfrom the.bash_profile, and<br/>
<br/>
- adding "AddKeysToAgent yes" to your.ssh/configfile (see "[How to makessh-agentautomatically add the key on demand?](https://superuser.com/a/1114257/141)").<br/>
<br/>
This way you don't even have to remember runningssh-add`.<br/>
<br/>
And Tao adds in the comments<br/>
<br/>
(Réponse tronquée)</t>