Skip to content

Commit

Permalink
Change the default branch name to main
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
DEGoodmanWilson and dscho committed Nov 12, 2020
1 parent e42e35d commit c071acb
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion refs.c
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down
2 changes: 1 addition & 1 deletion t/lib-submodule-update.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
)
}

Expand Down

0 comments on commit c071acb

Please sign in to comment.