From 9bf17a7eac4a52641d717530f3470c38f0a2bdbe Mon Sep 17 00:00:00 2001 From: Victor Giers Date: Thu, 27 Nov 2025 11:39:37 +0100 Subject: [PATCH] Ensure initial commit is created during Git repo initialization --- main.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/main.js b/main.js index 83c8547..c82af20 100755 --- a/main.js +++ b/main.js @@ -271,13 +271,14 @@ function watchRepo(folder, win) { /** * Initiiert ein Git-Repo in `folder`, falls noch nicht vorhanden, - * ohne Dateien oder Commits anzulegen. + * erzeugt bei Bedarf einen leeren Initial-Commit. */ async function initGitRepo(folder) { const git = simpleGit(folder); const gitDir = path.join(folder, '.git'); if (!fs.existsSync(gitDir)) { await git.init(); + await git.commit('initial commit', undefined, { '--allow-empty': null }); } }