angular-cli icon indicating copy to clipboard operation
angular-cli copied to clipboard

[ng new]: define main as inital branch name or make it configurable

Open willi84 opened this issue 1 year ago • 1 comments

Command

new

Description

background:

  • When you have a fresh installed system and not yet configured the main branch it will use master and git complains about using "master" as branch name.
  • discovered while preparing the ngGirls workshop, so it would be awesome to not have another command to avoid this warning.

to follow these best practises of e.g. using main, it would be awesome, when the following command

npx @angular/cli@latest new todo-list

is executed.

image

Describe the solution you'd like

  • creating by default a "main" branch
  • make an option to choose the initial branch

Describe alternatives you've considered

configure git branch like written, but for beginners it would be easier to skip this step

willi84 avatar Mar 18 '24 23:03 willi84

I spoke with @clydin about this. We could verify if "defaultBranch" is undefined and then use "main" for initialization. However, we shouldn't impose "main" as the branch name.

alan-agius4 avatar Mar 19 '24 14:03 alan-agius4