code: public RevCommit addAndCommit(Git git, String message) {
          try {
              git.add()
                  .addFilepattern(".")
                  .call();
              return git.commit()
                  .setMessage(message)
                  .call();
          } catch (GitAPIException e) {
              throw new IllegalStateException(e);
          }
      }
docs: Add all files and commit them with given message. This is equivalent as doing git add . git commit -m "message".
  
  @param git
  instance.
  @param message
  of the commit.
  
  @return RevCommit of this commit.