Skip to content

Instantly share code, notes, and snippets.

@JavierSegoviaCordoba
Last active March 18, 2024 15:37
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save JavierSegoviaCordoba/f6bc23f1149a4cad622d8065992ef853 to your computer and use it in GitHub Desktop.
Save JavierSegoviaCordoba/f6bc23f1149a4cad622d8065992ef853 to your computer and use it in GitHub Desktop.
Configure git and IntelliJ to force the usage of LF
  1. Add to .editorconfig in the root folder

    [*]
    end_of_line = lf
    insert_final_newline = true
    
  2. Add to .gitattributes in the root folder

    * text eol=lf
    
  3. Run git config core.autocrlf false

  4. Run git add --renormalize . in terminal

  5. In IntelliJ IDEA, select the root folder in the project view and then

    • File -> File Properties -> Line Separators -> LF Unix and macOS (\n)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment