Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDon Goodman-Wilson <don@goodman-wilson.com>2020-06-24 17:46:33 +0300
committerJunio C Hamano <gitster@pobox.com>2020-06-24 19:14:21 +0300
commit8747ebb7cde9e90d20794c06e6806f75cd540142 (patch)
tree2dedd0e043802202071b7490c1ba1a97ac03ad88 /builtin/init-db.c
parent32ba12dab2acf1ad11836a627956d1473f6b851a (diff)
init: allow setting the default for the initial branch name via the config
We just introduced the command-line option `--initial-branch=<branch-name>` to allow initializing a new repository with a different initial branch than the hard-coded one. To allow users to override the initial branch name more permanently (i.e. without having to specify the name manually for each and every `git init` invocation), let's introduce the `init.defaultBranch` config setting. Helped-by: Johannes Schindelin <johannes.schindelin@gmx.de> Helped-by: Derrick Stolee <dstolee@microsoft.com> Signed-off-by: Don Goodman-Wilson <don@goodman-wilson.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/init-db.c')
-rw-r--r--builtin/init-db.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/builtin/init-db.c b/builtin/init-db.c
index 8fdfc334ac..cee64823cb 100644
--- a/builtin/init-db.c
+++ b/builtin/init-db.c
@@ -269,7 +269,7 @@ static int create_default_files(const char *template_path,
char *ref;
if (!initial_branch)
- initial_branch = "master";
+ initial_branch = git_default_branch_name();
ref = xstrfmt("refs/heads/%s", initial_branch);
if (check_refname_format(ref, 0) < 0)