code: public static Iterable<PushResult> push(Git git, String remote, String branch,
                                              GitAuthenticationConfigurator authConfigurator) throws GitAPIException {
          PushCommand push = git.push();
          push.setRemote(remote);
          if (StringUtils.isNotEmpty(branch)) {
              push.setRefSpecs(new RefSpec(Constants.HEAD + ":" + Constants.R_HEADS + branch));
          }
  
          if (authConfigurator != null) {
              authConfigurator.configureAuthentication(push);
          }
  
          return push.call();
      }
docs: Executes a git push.
  
  @param git              the Git instance used to handle the repository
  @param remote           remote name or URL
  @param branch           the remote branch being pushed to
  @param authConfigurator the {@link GitAuthenticationConfigurator} class used to configure the authentication
  with the remote
  repository
  @return the result of the push
  @throws GitAPIException if a Git related error occurs