Skip to content

Commit 13442e4

Browse files
dschogitster
authored andcommitted
Document how the default branch name can be overridden
There is a `GIT_TEST_*` environment variable and a `core.` config setting (with the former taking precendence over the latter) to allow overriding what name Git uses by default as main branch of new repositories. Now that all kinds of Git operations have learned to respect those, let's document them. Signed-off-by: Johannes Schindelin <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent da15028 commit 13442e4

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

Documentation/config/core.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -626,3 +626,7 @@ core.abbrev::
626626
in your repository, which hopefully is enough for
627627
abbreviated object names to stay unique for some time.
628628
The minimum length is 4.
629+
630+
core.defaultBranchName::
631+
Allows overriding the default branch name e.g. when initializing
632+
a new repository or when cloning an empty repository.

t/README

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -421,6 +421,10 @@ GIT_TEST_DISALLOW_ABBREVIATED_OPTIONS=<boolean>, when true (which is
421421
the default when running tests), errors out when an abbreviated option
422422
is used.
423423

424+
GIT_TEST_DEFAULT_BRANCH_NAME allows overriding the default branch name
425+
that is used for example when initializing new repositories, or when
426+
cloning a repository that has no branches yet.
427+
424428
Naming Tests
425429
------------
426430

0 commit comments

Comments
 (0)