Skip to content

Commit 903203e

Browse files
committed
Initialize Git repository in PostCreateScript
Add commands to initialize a Git repository, set the default branch to "main," and make the initial commit. This ensures version control is activated immediately after project creation.
1 parent b22bd76 commit 903203e

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

builder/PostCreateScript.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,10 @@ public function execute($workdir, $namespace, $composerName, $phpVersion, $mysql
117117
}
118118

119119
shell_exec("composer update");
120+
shell_exec("git init");
121+
shell_exec("git branch -m main");
122+
shell_exec("git add .");
123+
shell_exec("git commit -m 'Initial commit'");
120124
}
121125

122126
/**

0 commit comments

Comments
 (0)