I am having some difficulties with a git client written in java. I am using the jGit library to connect through ssh on the git server. The problem is that i don\'t know how to s
I didn't ever use jGit, but from looking at the Javadocs (which are seemingly not online browsable, but can be downloaded) you need to configure a SshSessionFactory (i.e. create a subclass of JSchConfigSessionFactory, and override its configure
method).
The JSch object supports private keys with its addIdentity
methods, and the passphrases can be given with UserInfo objects to each individual JSch Session.
(Disclaimer: The JSch Javadoc was written by me.)