title: Running into TransportException "Nothing to push" when pushing changed file with JGit
body: <p>I'm using JGit to checkout a branch from my git repository and modify a file. After I committed the changes I try to push it but running into TransportException:</p>
  
  <pre><code>Caused by: org.eclipse.jgit.errors.TransportException: Nothing to push.
  at org.eclipse.jgit.transport.Transport.push(Transport.java:1332)
  at org.eclipse.jgit.api.PushCommand.call(PushCommand.java:169)
  ...
  </code></pre>
  
  <p>My code looks like this:</p>
  
  <pre><code>this.checkoutBranch(branchName);
  try (Writer writer = new OutputStreamWriter(new FileOutputStream(getFilePath(filepath).toFile(), true),
                      StandardCharsets.UTF_8))
  {
      Yaml yaml = this.initializeYaml();
      Map&lt;String, Object&gt; parameterMap = this.getParameterMap(filepath, yaml);
      parameterMap.put(key, value);
  
      // write file
      yaml.dump(parameterMap, writer);
  
      // commit and push
      git.add().addFilepattern(filepath).call();
      git.commit().setMessage("Added parameter with key: '" + key + "'").call();
  
      git.push().setCredentialsProvider(getCredentialProvider()).call();
  }
  catch(GitAPIException | IOException e)
  {
      throw new GitClientException("Cannot write parameters.", e);
  }
  </code></pre>
  
  <p>Here is the method for checking out the current branch:</p>
  
  <pre><code>public void checkoutBranch(String branchName)
  {
      try
      {
          git.checkout().setName("origin/" + branchName).call();
      }
      catch(GitAPIException e)
      {
          throw new GitClientException("Cannot checkout branch.", e);
      }
  }
  </code></pre>
  
  <p>I looked for JGit examples and I found many of them, but no example handles file changes.
  Has anybody a hint what could be wrong?</p>