Re: CRLF problems with Git on Win32
From: Steffen Prohaska <hidden>
Date: 2016-06-15 22:44:02
On Jan 7, 2008, at 2:50 PM, Peter Karlsson wrote:
Steffen Prohaska:quoted
Per default, CRLF conversion is disabled in msysgit. Git should not convert a single file. Does it really convert some?I didn't verify, but it was only some files that had LFs, perhaps the files that I added while on the Windows machine had CRLFs. That's bad.
This is a typical problem. Once CRLFs are in your repository autocrlf can't "just work" anymore. You need to commit a fixed version of the files.
Peter Klavins:quoted
Visual Studio in fact happily works with files that only have lf endings, _except_ *.sln and *.vcproj files, which it much prefers to have with cr/lf endings.The project files were added to the repository on the Windows box (obviously), so those are correct. So apparently my repository is a bit broken at the moment with LF on some files and CRLF on some. That's bad. I just assumed everything worked, it used to "just work" for CVS (except for when you actually tried to add binary files, of course).
"Just works" has a different meaning for git than it has for CVS. For git, it means that once you _told_ git how to convert line endings (that is you have correctly configured autocrlf), git will automatically detect text files and convert them, but leave binary files untouched. It "just works" in the sense that you do not need to explicitly tell git about every single binary files (no cvs -kb needed). Git will auto-detect the file type. But if you does tell git to convert line endings it "just works" as if every file was binary. Per default, git does not modify your content. And for some people, "just works" means exactly this: leave my content as is. So it really depends on the context and therefore some configuration is inevitable. git requires you to configure autocrlf. cvs requires you to set -kb. You may, though, set "core.autocrlf true" globally for your account. After you did this, git should "just work" for you; if "just works" means convert CRLF in _all_ text files in _every_ repository. Steffen