{"thread":{"id":"54665","subject":"Keeping the original init.defaultBranch config value","startedAt":"2020-11-18T16:46:58Z","lastAt":"2020-11-23T09:21:59Z","messageCount":3,"participants":["Peter Hadlaw","Junio C Hamano","Johannes Schindelin"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"410240","messageId":"CABrPy+GrSB87mFm5tXsXkC+OKg6NBxUJA5b0NYsa18a8EbcrNw@mail.gmail.com","threadId":"54665","inReplyTo":null,"subject":"Keeping the original init.defaultBranch config value","fromName":"Peter Hadlaw","fromEmail":"hadlawp@gmail.com","sentAt":"2020-11-18T16:46:30Z","receivedAt":"2020-11-18T16:46:58Z","isPatch":false,"sender":{"key":"hadlawp@gmail.com","avatar":"https://gravatar.com/avatar/5c112c7b0f8a2f31347a23b3c9461c416c1047e5f47ba5c0c588272c1f3b1cda?d=mp&s=160"},"body":"Hello,\n\nJust wanted to confirm that in order to keep new repositories\ninitializing with `master` as the default branch the command would be:\n\n```\ngit config --global init.defaultBranch master\n```\n\nRegards,\nPeter\n"},{"id":"410244","messageId":"xmqqd00a36wc.fsf@gitster.c.googlers.com","threadId":"54665","inReplyTo":"CABrPy+GrSB87mFm5tXsXkC+OKg6NBxUJA5b0NYsa18a8EbcrNw@mail.gmail.com","subject":"Re* Keeping the original init.defaultBranch config value","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2020-11-18T17:35:15Z","receivedAt":"2020-11-18T17:35:22Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Peter Hadlaw <hadlawp@gmail.com> writes:\n\n> Hello,\n>\n> Just wanted to confirm that in order to keep new repositories\n> initializing with `master` as the default branch the command would be:\n>\n> ```\n> git config --global init.defaultBranch master\n> ```\n\nYes.\n\nIf you have to ask the above question, that would mean the\ndocumentation we have right now probably is not clear enough.  \n\nIt is understandable, given that our documentation does not mention\nany future plan to change 'master' to other value, but it may still\nbe a good idea.\n\nThe following patch is on 'seen' with Dscho's \"prepare for main but\ndo not flip the final switch yet\" series.  I am not committed to the\nphrasing, but just showing it as a discussion starter.\n\nThanks.\n\n--- >8 ------ >8 ------ >8 --- cut here --- >8 ------ >8 ---\nSubject: \"init\" doc: mention the configurability more clearly\n\nUpdate the description for the '--initial-branch' option to mention\nthat the historical default has been `master` and it can be\nconfigured to use any name.  When actual transition happens to\nanother fixed name, say 'main', the description would further be\nupdated to mention like:\n\n\t... fall back to the default name 'main', but it can be\n\tcustomized with the `init.defaultBranch` configuration\n\tvariable.  Note that the default name historically was\n\t'master'.\n\nin order to help people who wonder why more mature projects or\ndocumentation tend not to say 'main'.\n\nWhile we are at it, stop referring to \"HEAD file\", which was a\nremnant from 2005 that talks too much about implementation detail.\nThe most important fact is that the current branch is set to an\nunborn branch and not detached HEAD.\n\nSigned-off-by: Junio C Hamano <gitster@pobox.com>\n---\n Documentation/git-init.txt | 11 +++++++----\n 1 file changed, 7 insertions(+), 4 deletions(-)\n\ndiff --git i/Documentation/git-init.txt w/Documentation/git-init.txt\nindex 59ecda6c17..62c7552a12 100644\n--- i/Documentation/git-init.txt\n+++ w/Documentation/git-init.txt\n@@ -20,8 +20,9 @@ DESCRIPTION\n \n This command creates an empty Git repository - basically a `.git`\n directory with subdirectories for `objects`, `refs/heads`,\n-`refs/tags`, and template files.  An initial `HEAD` file that\n-references the HEAD of the master branch is also created.\n+`refs/tags`, and template files.  An unborn branch (see the\n+`--initial-branch` option below for its name) is made to the current\n+branch.\n \n If the `$GIT_DIR` environment variable is set then it specifies a path\n to use instead of `./.git` for the base of the repository.\n@@ -73,8 +74,10 @@ If this is reinitialization, the repository will be moved to the specified path.\n -b <branch-name>::\n --initial-branch=<branch-name>::\n \n-Use the specified name for the initial branch in the newly created repository.\n-If not specified, fall back to the default name: `master`.\n+Use the specified name for the initial branch in the newly created\n+repository.  If not specified, fall back to the default name\n+'master', but it can be customized with the `init.defaultBranch`\n+configuration variable.\n \n --shared[=(false|true|umask|group|all|world|everybody|0xxx)]::\n \no\n"},{"id":"410516","messageId":"nycvar.QRO.7.76.6.2011221958240.56@tvgsbejvaqbjf.bet","threadId":"54665","inReplyTo":"xmqqd00a36wc.fsf@gitster.c.googlers.com","subject":"Re: Re* Keeping the original init.defaultBranch config value","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2020-11-22T19:00:28Z","receivedAt":"2020-11-23T09:21:59Z","isPatch":false,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi Junio,\n\nOn Wed, 18 Nov 2020, Junio C Hamano wrote:\n\n> --- >8 ------ >8 ------ >8 --- cut here --- >8 ------ >8 ---\n> Subject: \"init\" doc: mention the configurability more clearly\n>\n> Update the description for the '--initial-branch' option to mention\n> that the historical default has been `master` and it can be\n> configured to use any name.  When actual transition happens to\n> another fixed name, say 'main', the description would further be\n> updated to mention like:\n>\n> \t... fall back to the default name 'main', but it can be\n> \tcustomized with the `init.defaultBranch` configuration\n> \tvariable.  Note that the default name historically was\n> \t'master'.\n>\n> in order to help people who wonder why more mature projects or\n> documentation tend not to say 'main'.\n>\n> While we are at it, stop referring to \"HEAD file\", which was a\n> remnant from 2005 that talks too much about implementation detail.\n> The most important fact is that the current branch is set to an\n> unborn branch and not detached HEAD.\n>\n> Signed-off-by: Junio C Hamano <gitster@pobox.com>\n> ---\n\nJust to make sure to mention it: I transmogrified this patch into\nhttps://lore.kernel.org/git/1518387eaa95098707878459bc74bd5ef2179386.1606087406.git.gitgitgadget@gmail.com/\n\nThanks,\nDscho\n\n>  Documentation/git-init.txt | 11 +++++++----\n>  1 file changed, 7 insertions(+), 4 deletions(-)\n>\n> diff --git i/Documentation/git-init.txt w/Documentation/git-init.txt\n> index 59ecda6c17..62c7552a12 100644\n> --- i/Documentation/git-init.txt\n> +++ w/Documentation/git-init.txt\n> @@ -20,8 +20,9 @@ DESCRIPTION\n>\n>  This command creates an empty Git repository - basically a `.git`\n>  directory with subdirectories for `objects`, `refs/heads`,\n> -`refs/tags`, and template files.  An initial `HEAD` file that\n> -references the HEAD of the master branch is also created.\n> +`refs/tags`, and template files.  An unborn branch (see the\n> +`--initial-branch` option below for its name) is made to the current\n> +branch.\n>\n>  If the `$GIT_DIR` environment variable is set then it specifies a path\n>  to use instead of `./.git` for the base of the repository.\n> @@ -73,8 +74,10 @@ If this is reinitialization, the repository will be moved to the specified path.\n>  -b <branch-name>::\n>  --initial-branch=<branch-name>::\n>\n> -Use the specified name for the initial branch in the newly created repository.\n> -If not specified, fall back to the default name: `master`.\n> +Use the specified name for the initial branch in the newly created\n> +repository.  If not specified, fall back to the default name\n> +'master', but it can be customized with the `init.defaultBranch`\n> +configuration variable.\n>\n>  --shared[=(false|true|umask|group|all|world|everybody|0xxx)]::\n>\n> o\n>\n"}]}