code: public String checkinNewContent(String sourceDirectory, String message) throws Exception {
      RmCommand remove = git.rm();
      boolean hasFiles = false;
      for(String filename : new File(getBaseDirectory()).list()) {
        if(!filename.equals(".git")) {
          remove.addFilepattern(filename);
          hasFiles = true;
        }
      }
      if(hasFiles) {
        log.info("Removing old content.");
        remove.call();
      }
      log.info("Copying in new content.");
      FileSystemManager.copyAllContent(sourceDirectory, getBaseDirectory(), true);
      log.info("Adding new content.");
      AddCommand add = git.add();
      for(String filename : new File(getBaseDirectory()).list()) {
        if(!filename.equals(".git")) {
          add.addFilepattern(filename);
        }
      }
      add.call();
      log.info("Committing new content.");
      git.commit().setMessage(message).call();
      return getCurrentRevision();
    }
docs: Checks in content from a source directory into the current git repository.
  @param sourceDirectory The directory to pull content in from.
  @param message The commit message to use.
  @return The new SHA revision.
  @throws Exception