Skip to content

Avoid "LF will be replaced by CRLF the next time Git touches it" warning on Windows #26764

@doggy8088

Description

@doggy8088

Command

new

Description

I know the LF will be replaced by CRLF the next time Git touches it is a warning message that can safely be ignored. Some Angular newbies might feel confused sometimes. Is it possible to avoid this message been shown to the user?

Describe the solution you'd like

I think this could be configurable for default newline characters. It can be detected easily for user's core.autocrlf setting of Git. So it's possible that change the newline of all the generated text file from LF to CRLF when needed.

Describe alternatives you've considered

Workaround 1: Avoid git init after ng new and do it by user itself

ng new demo1 --skip-git
cd demo1
git init -b main
git config --local core.autocrlf false
git add . && git commit -m "Initial commit"

Workaround 2: Change core.autocrlf setting of Git to false

git config --global core.autocrlf false

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions