Bug 564794 - Allow to configure default branch name
Summary: Allow to configure default branch name
Status: RESOLVED FIXED
Alias: None
Product: JGit
Classification: Technology
Component: JGit (show other bugs)
Version: unspecified   Edit
Hardware: PC Mac OS X
: P3 enhancement (vote)
Target Milestone: 5.11   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 571761 (view as bug list)
Depends on:
Blocks:
 
Reported: 2020-06-30 09:31 EDT by Matthias Sohn CLA
Modified: 2021-10-07 02:59 EDT (History)
5 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Matthias Sohn CLA 2020-06-30 09:31:25 EDT
The git community is working on improving terminology to be more respectful and is working on adding support to use a different default branch name than "master"

They decided to introduce a new option core.defaultBranch to configure the default branch to be used e.g. when a new repository is created.

This new option didn't yet reach a git release, it's currently cooking [1].
Here is the original discussion on the git list [2].

In addition a new option core.mainBranch is being introduced to record to which name the default branch of a given repository was set [3].

JGit should also add support for these new options.

[1] https://lore.kernel.org/git/xmqqimfid2l1.fsf@gitster.c.googlers.com/
[2] https://lore.kernel.org/git/20200629085957.GS21462@kitsune.suse.cz/
[3] https://lore.kernel.org/git/933e314813df34aafca1a47bfc1fcba389dd5364.1592225416.git.gitgitgadget@gmail.com/
Comment 1 Matthias Sohn CLA 2020-11-11 20:03:32 EST
git now supports configuration of the default branch via option init.defaultbranch [4]

[4] https://git-scm.com/docs/git-config#Documentation/git-config.txt-initdefaultBranch
Comment 2 Eclipse Genie CLA 2021-01-24 20:54:40 EST
New Gerrit change created: https://git.eclipse.org/r/c/jgit/jgit/+/175296
Comment 3 Eclipse Genie CLA 2021-01-24 20:54:42 EST
New Gerrit change created: https://git.eclipse.org/r/c/jgit/jgit/+/175297
Comment 6 Eclipse Genie CLA 2021-02-23 17:09:33 EST
New Gerrit change created: https://git.eclipse.org/r/c/egit/egit/+/176758
Comment 8 Matthias Sohn CLA 2021-03-07 17:18:57 EST
*** Bug 571761 has been marked as a duplicate of this bug. ***
Comment 9 Konrad Windszus CLA 2021-10-07 02:59:39 EDT
Am I missing something or is the UI missing for renaming an unborn branch? When trying to commit to an empty repository (e.g. at GitHub) I only see the hint

"Unborn branch: this commit will create the branch 'master'". I can neither use "Team->Switch To->New Branch" nor "Team->Advanced->Rename Branch" in that situation. Is this already tracked somewhere?