Skip to content
This repository has been archived by the owner on Dec 15, 2022. It is now read-only.

Default branch name of new git repositories is master, despite init.defaultbranch settings #2755

Open
1 task done
TomVincentUK opened this issue Apr 8, 2022 · 1 comment

Comments

@TomVincentUK
Copy link

TomVincentUK commented Apr 8, 2022

Prerequisites

Description

When creating a new git repository via the built in Atom GUI, the default branch name is master, even though my default git branch name (init.defaultbranch) is main when invoking git from a terminal.

Steps to Reproduce

  1. Open Atom in a new directory
  2. Create a new git repository using the Create repository button
  3. Add a file and make the first commit to the repository using the Create detached commit button
  4. Check the name of the created branch

Expected behavior:

The branch created should be named to match either init.defaultbranch from the user's gitconfig, or to main (to match the default behaviour for new github repositories).

Actual behavior:

The default branch is named master

Reproduces how often:

100%

Versions

Windows 10

> atom --version

Atom    : 1.60.0
Electron: 9.4.4
Chrome  : 83.0.4103.122
Node    : 12.14.1
> apm --version
apm  2.6.2
npm  6.14.13
node 12.14.1 x64
atom 1.60.0
python 3.9.1
git 2.33.1.windows.1
visual studio

Additional Information

My Stack Overflow post on this topic: issue was reproduced on Ubuntu by other user

@kgjenkins
Copy link

I don't really know my way around the code in this repo, but it looks like the default branch name "master" is hardcoded in the publishRepository() function here:
https://github.com/atom/github/blob/master/lib/views/create-dialog.js#L49-L55

wesinator added a commit to wesinator/github-atom that referenced this issue Nov 27, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants