title: Configuring known_hosts in jgit
body: <p>Using jgit with gitolite for source control, I have an application that generates certain code on command and which we want to be committed to source control.  The goal is to pull with a fast forward, commit the new code, and then push it.</p>
  
  <p>I have the following method:</p>
  
  <pre><code>private void commitToGitRepository(String updateComment, Config config)
        throws IOException, NoFilepatternException, GitAPIException
  {
     if(git == null)
     {
        git = Git.open(new File(config.getDpuCheckoutDir()));
     }
     PullCommand pull = git.pull();
     pull.call();
  }
  </code></pre>
  
  <p>This method fails on the <code>pull.call()</code> method call, with the following exception:</p>
  
  <pre><code>com.jcraft.jsch.JSchException: UnknownHostKey: www.somehost.com. RSA key fingerprint is 9d:92:a9:c5:5d:cb:5f:dc:57:ff:38:7e:34:31:fe:75
  at com.jcraft.jsch.Session.checkHost(Session.java:748)
  at com.jcraft.jsch.Session.connect(Session.java:319)
  at org.eclipse.jgit.transport.JschConfigSessionFactory.getSession(JschConfigSessionFactory.java:116)
  at org.eclipse.jgit.transport.SshTransport.getSession(SshTransport.java:121)
  at org.eclipse.jgit.transport.TransportGitSsh$SshFetchConnection.&lt;init&gt;(TransportGitSsh.java:248)
  at org.eclipse.jgit.transport.TransportGitSsh.openFetch(TransportGitSsh.java:147)
  at org.eclipse.jgit.transport.FetchProcess.executeImp(FetchProcess.java:136)
  at org.eclipse.jgit.transport.FetchProcess.execute(FetchProcess.java:122)
  at org.eclipse.jgit.transport.Transport.fetch(Transport.java:1104)
  at org.eclipse.jgit.api.FetchCommand.call(FetchCommand.java:128)
  at org.eclipse.jgit.api.PullCommand.call(PullCommand.java:245)
  at net.intellidata.dpu.controller.schema.EntityMappingController.commitToGitRepository(EntityMappingController.java:149)
  ... (truncated where it meets my code)
  </code></pre>
  
  <p>The way I read this, it seems that it's not finding my known_hosts file in <code>user_home/.git</code>.  However, I've been searching for an hour and I'm not finding a way to configure JGit to tell JSch where to look for the known_hosts file.</p>
  
  <p>Suggestions?  I know the entry for the origin is present in my known_hosts file</p>