Is there a way to determine the line endings in a existing git repository?
If I clone a existing repository how do I determine what core.autocrlf was used by the creator?
I'm still uncertain whats the best setting for core.autocrlf e.g on a windows box (since there are multiple opinions: Distributing git configuration with the code or https://help.github.com/articles/dealing-with-line-endings)
Bonus question: Can you determine on windows (with standard tools) if a repo has mixed line endings (by wrong core.autocrlf setting) through all commits?
The best line endings practice is here: https://stackoverflow.com/a/10855862
To determine the line endings in a existing git repository:
core.autocrlf
tofalse
, so it will not change file endings while transmitting files.git clone
your repo for ex. in a new directory.You can't determine what core.autocrlf was used by the creator as it is local config except the repo has .gitattributes file.
On Windows if you are not using .gitattributes just use core.autocrlf true as it set by default.