Browse Source
This should prevent accidentally committing files with CRLF line endings to the repo. related: https://github.com/spesmilo/electrum/issues/8025 see https://git-scm.com/docs/gitattributes#_end_of_line_conversion : > If you want to ensure that text files that any contributor introduces to the repository have their line endings normalized, you can set the text attribute to "auto" for all files. > ``` > * text=auto > ``` > > From a clean working directory: > $ echo "* text=auto" >.gitattributes > $ git add --renormalize . > $ git status # Show files that will be normalized > $ git commit -m "Introduce end-of-line normalization" ----- I have tried to find some large cross-platform projects that use git for EOL normalisation. Notably the golang/go project recommends against it, but the others have it in some form:patch-44ec9ed8fde/.gitattributes
160bb0e66b/.gitattributes
7fda097623/.gitattributes
103a5c98b8/.gitattributes
0990046d8d/.gitattributes
1c2dc79f51/.gitattributes
0d65a985b9/.gitattributes
d3bafb8b6e/.gitattributes
1 changed files with 12 additions and 0 deletions
@ -0,0 +1,12 @@ |
|||
# Auto detect text files and perform end-of-line normalization (to LF) |
|||
* text=auto |
|||
|
|||
# These Windows files should have CRLF line endings in checkout |
|||
*.bat text eol=crlf |
|||
*.ps1 text eol=crlf |
|||
|
|||
# Never perform LF normalization on these files |
|||
*.ico binary |
|||
*.jar binary |
|||
*.png binary |
|||
*.zip binary |
Loading…
Reference in new issue