Skip to content

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

Closed

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

Activity

  1. added a commit that references this issue on Dec 29, 2023
    cea709f
  2. added
    freq1: low
    on Dec 29, 2023
  3. added 2 commits that reference this issue on Dec 29, 2023
    2da825b
    d151ccc
  4. added 2 commits that reference this issue on Jan 3, 2024
    88d6ca4
    7e9bbe4
  5. slavede commented on Feb 1, 2024

    @slavede
    Contributor

    To be honest, this has become anoying now. Even though I am using windows as development environment, I don't want that CLI generates OS specific files since we all agreed to use LF line endings.
    I believe this should be configurable in cli

  6. alan-agius4 commented on Feb 1, 2024

    @alan-agius4
    Collaborator

    @slavede, this has been solved. Please update to the latest stable version.

  7. slavede commented on Feb 1, 2024

    @slavede
    Contributor

    Is there a way of telling angular cli generate command to use LF (even though I'm on Windows)? Because, to me, solution seems to forcing platform specific line endings

  8. angular-automatic-lock-bot commented on Mar 3, 2024

    @angular-automatic-lock-bot

    This issue has been automatically locked due to inactivity.
    Please file a new issue if you are encountering a similar or related problem.

    Read more about our automatic conversation locking policy.

    This action has been performed automatically by a bot.

  9. locked and limited conversation to collaborators on Mar 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: @angular-devkit/corefreq1: lowseverity2: inconvenienttype: bug/fix

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions