title: How to fetch only new changes from GIT Hub using JGIT
body: <p>I written a below script to clone a repository, and It works fine. Also I'm using TestNG library to execute the script.</p>
  
  <pre><code>    @BeforeClass
      public static void cloneGit() throws Exception 
      {
        String url = "https://${oauthtoken}@github.amazon.com/arrchanaMohan/xxxreports";
        String destination = ".//clone1//";
  
        CredentialsProvider credentialsProvider = new UsernamePasswordCredentialsProvider(
                  "${oauthtoken}", "");
  
        CloneCommand clone = Git.cloneRepository();
        clone.setURI(url);
        clone.setCredentialsProvider(credentialsProvider);
        clone.setDirectory(Paths.get(destination).toFile());
        clone.call();
      }
  </code></pre>
  
  <p>I just want to clone the git repository once before It starts executing @Test method in a class, and It did. but Most of the time I encounter the below error message in output console.</p>
  
  <pre><code>  SKIPPED: insertRecords
    java.lang.RuntimeException: org.eclipse.jgit.api.errors.JGitInternalException: Destination path "clone1" already exists and is not an empty directory
      at org.testng.internal.MethodInvocationHelper.invokeDataProvider(MethodInvocationHelper.java:163)
  </code></pre>
  
  <p>To avoid this I just wanna perform "fetch" action. I already cloned the repo in my local If It exist then it needs to fetch only the updated records from the repo instead of again performing "clone" action. </p>
  
  <p>Any leads?</p>