[PATCH 28/28] Change the default branch name to `main`
- From
Don Goodman-Wilson via GitGitGadget <gitgitgadget@gmail.com>
- Date
- Nov 12, 2020, 22:43 UTC
- Message-ID
- <f853fa946f5840518577584a5b8c51660da06928.1605221040.git.gitgitgadget@gmail.com>
- In-Reply-To
- <pull.762.git.1605221038.gitgitgadget@gmail.com>
From: Don Goodman-Wilson <don@goodman-wilson.com>
The current default name for the initial branch is a loaded term, and many Open Source projects renamed their principal branches already. A common choice appears to be `main`.
Let's follow their lead and change the default of `init.defaultBranch`.
Co-authored-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Don Goodman-Wilson <don@goodman-wilson.com> --- refs.c | 2 +- t/lib-submodule-update.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/refs.c b/refs.c index 392f0bbf68..5576a90573 100644 --- a/refs.c +++ b/refs.c @@ -575,7 +575,7 @@ char *repo_default_branch_name(struct repository *r) die(_("could not retrieve `%s`"), config_display_key); if (!ret) - ret = xstrdup("master"); + ret = xstrdup("main"); full_ref = xstrfmt("refs/heads/%s", ret); if (check_refname_format(full_ref, 0)) diff --git a/t/lib-submodule-update.sh b/t/lib-submodule-update.sh index bd3fa3c6da..1b0abcb0f8 100644 --- a/t/lib-submodule-update.sh +++ b/t/lib-submodule-update.sh @@ -144,7 +144,7 @@ create_lib_submodule_repo () { git checkout -b valid_sub1 && git revert HEAD && - git checkout "${GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME-master}" + git checkout "${GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME-main}" ) }
-- gitgitgadget