conan-io / docs

conan.io reStructuredText documentation
http://docs.conan.io
MIT License
110 stars 359 forks source link

Improve documentation for git line endings #3415

Open samuel-emrys opened 1 year ago

samuel-emrys commented 1 year ago

This has been raised in the slack channel a number of times, and the proposed solution in the documentation hasn't worked for me in the past (not saying it doesn't work at all, just didn't in my circumstance). It might be worth expanding this to include a .gitattributes solution, in which a .gitattributes file is placed in the root of the repository with the following:

* text=auto eol=lf
*.bat eol=crlf
*.cmd eol=crlf
*.ps1 eol=crlf

Then, to apply these changes to a repository that's already been checked out and/or fix the line endings in the index:

git rm --cached -r .
git reset --hard
git add --renormalize .
git commit

For a reasonably comprehensive discussion of the issues, see this slack conversation

memsharded commented 1 year ago

Thanks for raising this @samuel-emrys

It looks like that the docs solution is a legacy-git one. Let's have a look and try to improve this, thanks very much for your hints!