You can use a shell script to do the git checkout/add/commit/checkout/push as Jake Wharton suggested, and configure Ant or Gradle to run the shell script after it generates the javadoc. I'm not sure this would work with Maven. Here's an example shell script.