简体   繁体   中英

How can I enter my passphrase only once in Git CMD?

After installing Git for Windows, I am using Git CMD (not Git Bash). I have a passphrase-protected private key stored at %USERPROFILE%/.ssh/id_rsa

I am running a script that performs Git actions on multiple repos. Every time it interacts with a new repo I have to enter my passphrase again.

Is there any way I can enter my passphrase only once (kind of like Pageant)?

Yes you can do this. After you launch Git CMD run

start-ssh-agent

You will be prompted for your passphrase, and the ssh-agent will store your private key for future use (you can find the ssh-agent.exe process in your Task Manager).

Any Git commands that are used after that will access your private key via ssh-agent, until the end of your desktop session.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM