title: Usage of 'pull' command in Jgit
body: <p>I'm a new user of git and am using <a href="http://wiki.eclipse.org/JGit" rel="noreferrer">JGit</a> to interact with a remote git repository. In JGit, I used <code>CloneCommand</code> to initially to clone a repo, and it worked without a issue. However, when I try to use <code>PullCommand</code>, which is the equivalent of SVN update AFAIK, the local repo contents are not updated. </p>
  
  <p>This is the code that I used:</p>
  
  <pre><code>private String localPath;
  private Repository localRepo;
  private Git git;
  
  localPath = "/home/test/git_repo_test";
  remotePath = "https://github.com/test/repo_1.git";
  
  try {
      localRepo = new FileRepository(localPath + "/.git");
  } catch (IOException e) {
      e.printStackTrace();  
  }
  git = new Git(localRepo);
  
  PullCommand pullCmd = git.pull();
  try {
      pullCmd.call();
  } catch (GitAPIException e) {
      e.printStackTrace();  
  }
  </code></pre>
  
  <p>This doesn't update the local repository for new files which I have pushed to the remote repository using the command line. However, if I delete the local repository and take a clone again, all the changes are reflected. </p>
  
  <p>Please let me know what is the correct approach of using <code>PullCommand</code> in JGit.</p>
  
  <p>EDIT:</p>
  
  <p>The structure of the remote repository:</p>
  
  <pre><code>root ____ file_1
    |______ directory_1
                |__________ file_2 
                |__________ file_3
  </code></pre>
  
  <p>directory_1 and the two files are pushed from the commandline after the initial cloning and I tried this code so that it will get reflected in the local repository, which is not happening.</p>
  
  <p>The code used to clone the repository:</p>
  
  <pre><code>File file = new File(localPath);
  CloneCommand cloneCmd = git.cloneRepository();
  try {
      cloneCmd.setURI(remotePath)
              .setDirectory(file)
              .call();
  } catch (GitAPIException e) {
      e.printStackTrace();  
  }
  </code></pre>
  
  <p>Here, <code>git</code>, <code>localPath</code> and <code>remotePath</code> are the same variable as above.</p>