Commit ba35b76a authored by liaozan's avatar liaozan 🏀

feat: create git branch

parent f3599e6e
......@@ -65,9 +65,11 @@ public class MavenUtils {
private static void initGitRepo(Path directory) {
try {
Git git = Git.init().setDirectory(directory.toFile()).call();
Git git = Git.init().setInitialBranch("master").setDirectory(directory.toFile()).call();
git.add().addFilepattern(".").call();
git.commit().setAllowEmpty(true).setAuthor("initializer", "no-reply@schbrain.com").setMessage("Initial Commit").call();
git.checkout().setCreateBranch(true).setName("release").call();
git.checkout().setCreateBranch(true).setName("develop").call();
git.close();
} catch (GitAPIException e) {
log.warn("Git repo init failed", e);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment