Merge pull request #33771 from overleaf/mj-git-bridge-default-main

[git-bridge] Default new projects to main rather than master

GitOrigin-RevId: 3d7d60c0aab6e5d0d10d282d6d491d4f735ed94c
This commit is contained in:
David
2026-06-12 08:06:20 +00:00
committed by Copybot
parent 886985d91c
commit f27112179a
10 changed files with 191 additions and 5 deletions
@@ -14,6 +14,7 @@ import org.apache.commons.io.IOUtils;
import org.eclipse.jgit.api.Git;
import org.eclipse.jgit.api.ResetCommand;
import org.eclipse.jgit.api.errors.GitAPIException;
import org.eclipse.jgit.lib.Constants;
import org.eclipse.jgit.lib.PersonIdent;
import org.eclipse.jgit.lib.Repository;
import org.eclipse.jgit.storage.file.FileRepositoryBuilder;
@@ -83,6 +84,8 @@ public class GitProjectRepo implements ProjectRepo {
return;
}
repo.create();
// Set default branch to "main" for new projects
repo.updateRef(Constants.HEAD).link("refs/heads/main");
}
@Override