Default branch name of new git repositories is `master`, despite init.defaultbranch settings
TomVincentUK opened this issue · 1 comments
Prerequisites
- Put an X between the brackets on this line if you have done all of the following:
- Reproduced the problem in Safe Mode: https://flight-manual.atom.io/hacking-atom/sections/debugging/#using-safe-mode
- Followed all applicable steps in the debugging guide: https://flight-manual.atom.io/hacking-atom/sections/debugging/
- Checked the FAQs on the message board for common solutions: https://discuss.atom.io/c/faq
- Checked that your issue isn't already filed: https://github.com/issues?utf8=✓&q=is%3Aissue+user%3Aatom
- Checked that there is not already an Atom package that provides the described functionality: https://atom.io/packages
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
- Open Atom in a new directory
- Create a new git repository using the
Create repository
button - Add a file and make the first commit to the repository using the
Create detached commit
button - 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
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