Skip to content

Respect init.defaultBranch configuration value when initializing a Git repository #3719

Closed

Description

@julianmontague

Description

Git added the init.defaultBranch config value a while ago. It allows specifying the default branch name (to deviate from the historical default "master"). Netbeans currently (version 13.0) uses master regardless of the git global config.

Use case/motivation

When I use Netbeans to initialize a Git repo, I want it to use the branch specified by the mentioned config value. Instead, when I initialize a Git repo and make my first commit it is always on the master branch.

In my case, git config --global init.defaultBranch returns main so I expect NetBeans to respect this.

Related issues

Jira issue NETBEANS-4990. Another duplicate Jira issue was created in August 2021: NETBEANS-5903.

Comments on these issues mentioned this not being supported in JGit, but this has since changed. Bug 564794 was resolved in late February 2021.

Are you willing to submit a PR?

  • Yes I am willing to submit a PR!

Code of Conduct

Activity

  1. added
    kind:feature
    needs:triage
    on Mar 7, 2022
  2. removed
    needs:triage
    on Mar 7, 2022
  3. added
    git
    Contribution welcome
    on Jul 3, 2022
  4. ChristoforosKor commented on Sep 3, 2023

    @ChristoforosKor

    This is a very nice feature to have.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Contribution welcomegitkind:feature

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions