title: How to use jgit to clone the existing repositories to new github instance?
body: <p>We have two separate GitHub instance running. One GitHub instance is <code>https://github.dev.host.com</code> and other github instance is <code>https://github.host.com</code>. I have various repositories in <code>https://github.dev.host.com</code> which I need to migrate to this new github instance <code>https://github.host.com</code>.</p>
  
  <p>I am using JGit as I am working with Java. For example - Below are the repositories that are present in <code>https://github.dev.host.com</code> instance which I need to migrate to new github instance <code>https://github.host.com</code></p>
  
  <pre><code>https://github.dev.host.com/Database/ClientService
  https://github.dev.host.com/Database/Interest
  </code></pre>
  
  <p>As I am using JGit so I want to create these two above repositories in my new  GitHub instance through Java code. And after running my Java code, I should see all the above respositories and all its branches and contents from my <code>https://github.dev.host.com</code> into my new Github instance <code>https://github.host.com</code> as shown something like below -</p>
  
  <pre><code>https://github.host.com/Database/ClientService
  https://github.host.com/Database/Interest
  </code></pre>
  
  <p>I just need to iterate the all the repositories list which I have in my old github instance and create those if they don't exit with all its contents and branches in my new github instance. And if they already exists, then overwrite all the changes from old to new instance.</p>
  
  <p>Is this possible to do this using JGit? I also have <code>https</code> access to my both the github instances through my username and password.</p>
  
  <p>As of now I can only do basic stuff as shown below which I learnt going through the tutorial.</p>
  
  <pre><code>public class CreateNewRepository {
  
      public static void main(String[] args) throws IOException {
          // prepare a new folder
          File localPath = File.createTempFile("TestGitRepository", "");
          localPath.delete();
  
          // create the directory
          Repository repository = FileRepositoryBuilder.create(new File(localPath, ".git"));
          repository.create();
  
          System.out.println("Having repository: " + repository.getDirectory());
  
          repository.close();
  
          FileUtils.deleteDirectory(localPath);
      }
  }
  </code></pre>
  
  <p>Any suggestions will be of great help as this is my first time working with JGit.   </p>