Skip to content
GitLab Next
  • Menu
Projects Groups Snippets
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • GitLab GitLab
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 43,795
    • Issues 43,795
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
    • Requirements
  • Merge requests 1,418
    • Merge requests 1,418
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
    • Test Cases
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages & Registries
    • Packages & Registries
    • Package Registry
    • Container Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Metrics
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Code review
    • Insights
    • Issue
    • Repository
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • GitLab.org
  • GitLabGitLab
  • Issues
  • #220906
Closed
Open
Created Jun 09, 2020 by Nick Thomas@nick.thomas🆓Contributor

Provide choice of initial branch name when GitLab creates a repository for a user

Problem to solve

The default initial branch name when using git is master. This has raised eyebrows among some.

Git itself does have support for changing the default name of the initial branch to be something else, and there isn't consensus on the "best" default name anyway. We have tended to use master for our own projects, but I'm accustomed to seeing Git projects where the default branch is called develop, which makes a lot of sense when (as in Git Flow or GitLab Flow), release branches are made off it.

The tweet mentions the name release as a potential option. It's not something I've seen before, but is a reasonable name for a rolling-release project.

Mercurial calls the default initial branch... well, default.

GitLab is currently fairly opinionated about the default initial branch name, despite this diversity of preferences - in most situations, it will create a new project with a master branch, or configured for the first new branch to be master, without any user input, and without providing any choice to the user.

Intended users

  • Delaney (Development Team Lead)
  • Sasha (Software Developer)
  • Rachel (Release Manager)

User experience goal

Freedom of choice for new projects

Proposal

When using any of these project creation options:

Screenshot_from_2020-06-09_10-47-14

If the initial branch name to be used isn't clear from the context, then we should prompt the user to choose from a list of standard options, also permitting free-form entry.

The default could continue to be master, since that has most interoperability at the moment, or we could consider making it group-level configurable, which would be handy for organisations to express a particular standard (say, they have decided to call the default initial branch develop across their organisation).

The default branch to use is clear from context when importing an already-existing repository, whether from a GitLab export or third-party repo, since that specifies the default branch to use.

Creating a new empty repository, one with a README, or creating a new repository from a template, all leave the question open.

Further details

Naming is hard 😅.

This issue is triggered from BLM, but default, develop, etc, do predate that.

Whether master is an appropriate term in this context or not is probably best taken up at the git-project-level, but even if git decided to change their default to default, to match mercurial, as a consequence, people would still want to call their default branch develop in some cases.

Is this a cross-stage feature?

To an extent, this is groupsource code , but devopsmanage are responsible for project templates, I believe. It doesn't require any change to project templates themselves; they will all have the master branch in their bundles, but we can change it in a post-export step. We could go through and rename the default in all of them to default, if we felt like it.

Links / references

Edited Jun 26, 2020 by Pedro Moreira da Silva
Assignee
Assign to
Time tracking