问题
I am trying to call git fetch from command prompt in windows, the only problem is that it asks for the passphrase of the private key. I have it, but is it possible to be supplied automatically like giving it in an argument to git fetch? I know ssh agent asks for the password only once when you open the terminal, but that is not a solution for me as i want the process to be automatic without user interaction, the best solution would be if i can give it as an argument. Thank you.
EDIT: Thank you for your answers. What i was trying to accomplish is to build a simple git notifier in Titanium Developer. For that i wanted to support all authentication methods including ssh with passphrase. In smartgit client for example you can supply the private key and the passphrase(if you have one) for each project, then you can use the available git commands. I wanted to know if it is possible to enter the passhprase automatically from the console as that would have been the easiest way to do this, but i guess i will have to go with java or C.
回答1:
I believe the only way to do what you're looking for is with some kind of auto-typing feature. I've seen a few mentioned in discussions of SSH and logging in without a password or passphrase. The general consensus on using them is "don't". They're incredibly unsecure. You should maybe just remove the passphrase from the private key if you don't want it to be required.
来源:https://stackoverflow.com/questions/7296464/git-ssh-private-key-passphrase