public void commit ( String msg ) throws GitAPIException { try ( Git git = getGit ( ) ) { Status status = git . status ( ) . call ( ) ; if ( ! status . isClean ( ) ) { git . commit ( ) . setMessage ( msg ) . setAll ( true ) . setNoVerify ( true ) . call ( ) ; } } }
Commit all changes if there are uncommitted changes .