angular-cli
angular-cli copied to clipboard
[ng new]: define main as inital branch name or make it configurable
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.
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
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.