git status shows modifications even with autocrlf=false
This seems like a bug in msysgit indeed. As a workaround, try creating a .gitattributes file containing
* -text
This will tell git not to perform EOL conversions on any files.
Check if you have no .gitattributes
file
As mentioned in the "Effect" section of the gitattributes
man page, those files can also have an effect on eol and automatic transformation:
text ^^^^^^
This attribute enables and controls end-of-line normalization.
When a text file is normalized, its line endings are converted toLF
in the repository.
To control what line ending style is used in the working directory, use the eol attribute for a single file and thecore.eol
configuration variable for all text files.
Check also your config for core.eol
, as mentioned in "How line ending conversions work with git core.autocrlf
between different operating systems".
I'm investigating the weird behavior of core.autocrlf in MSysGit, and I found that having:
[core] autocrlf = false safecrlf = true ignorecase = true eol = native
in the global config file and NO core.autocrlf setting in a repo copied from another PC (not cloned, only copied), issuing a git status
command results in ALL text files marked as modified (no gitattributes around).
But if you add a local (repository) core.autocrlf setting to true, and then issue a git status
command, all the changes disappears and the repository turns back to be clean.
BUT (and this is the strange behavior) if you remove the just added core.autocrlf setting from the repository config file (thus returning to the exact initial state), the git status command continues to report no changes!
Given that no operations has been performed on the repository, only changing a config setting, and reverting back to the original state, has done the trick...
If this isn't a bug, I can't imagine who in the world can call this a "normal" behavior.