diff --git a/packages/node_modules/@node-red/runtime/lib/storage/localfilesystem/projects/git/index.js b/packages/node_modules/@node-red/runtime/lib/storage/localfilesystem/projects/git/index.js index 8aabcebe2..77b9ad2cd 100644 --- a/packages/node_modules/@node-red/runtime/lib/storage/localfilesystem/projects/git/index.js +++ b/packages/node_modules/@node-red/runtime/lib/storage/localfilesystem/projects/git/index.js @@ -421,7 +421,10 @@ module.exports = { }); }, initRepo: function(cwd) { - return runGitCommand(["init"],cwd); + var args = ["init", "--initial-branch", "main"]; + return runGitCommand(args, cwd).catch(function () { + return runGitCommand(["init"], cwd); + }); }, setUpstream: function(cwd,remoteBranch) { var args = ["branch","--set-upstream-to",remoteBranch];