SomberNight
|
2089f06ffa
|
add .gitattributes file for end-of-line normalisation
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:
4ec9ed8fde/.gitattributes
160bb0e66b/.gitattributes
7fda097623/.gitattributes
103a5c98b8/.gitattributes
0990046d8d/.gitattributes
1c2dc79f51/.gitattributes
0d65a985b9/.gitattributes
d3bafb8b6e/.gitattributes
|
3 years ago |