I have a Git repo that until now was primarily used for Windows development. Most aspects of the Git EOL issues (LF vs. CRLF) were not significant and development proceeded without hindrance.
Having moved to a CMake build environment, I want to build the code on UNIX/Linux/MacOS. The code itself is portable but from past experience and some initial experiments, the transition is somewhat painful with Git marking whole directories on untouched files as modified, detects seemingly unmodified lines within files and screwing up case-[in]sensitive file/folder names.
Additionally, it seems that as of Git 1.7.2, Git has a new EOL system based on the local, per-project, checked-in, .gitattributes
instead of the, per-user, global, .gitattributes
that each use on each platform should set.
Can anyone suggest a repo preparation path/process (on Windows) that will allow me to pull and commit files on Linux without all these troubles?
A partial suggestions can be seen, e.g. here, but that is too brute force and does not take into account files that the .gitattributes
specifically intended to leave as-is (e.g. *.sln
)
In general, do not automatically convert data before storing it in a VCS (autocrlf=false in git IIRC), otherwise you will get false positives about the data having changed when it didn't. Leave any "interpretation" of what the data means to tools outside the VCS (editor, etc).
To prevent spurious newline changes, consider: