fix(repository): initialise repositories with "main" default branch
+ 7
- 1
app/services/repository/createRepository.ts
@@ -66,7 +66,13 @@ const makeCreateRepository: ServiceMethodFactory<
 
     const gitInitBareRepoProcess = spawn(
       "git",
-      ["init", "--bare", "--shared=group", `${newRepo.slug}.git`],
+      [
+        "init",
+        "--bare",
+        "--initial-branch=main",
+        "--shared=group",
+        `${newRepo.slug}.git`,
+      ],
       { cwd: orgRepositoriesDir.toString() }
     );