From 5bda221f9dcae1e715852fe6217086a226b75790 Mon Sep 17 00:00:00 2001 From: Kazuhito Yokoi Date: Tue, 31 Jan 2023 00:36:18 +0900 Subject: [PATCH] Use main branch as default in project feature --- .../lib/storage/localfilesystem/projects/git/index.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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];