From: Steffen Prohaska Date: Mon, 07 Jan 2008 09:57:52 GMT Subject: Re: CRLF problems with Git on Win32 Message-ID: <5C0F88FD-AB2F-4BAD-ADEC-75428F14260F@zib.de> In-Reply-To: On Jan 7, 2008, at 10:16 AM, Peter Karlsson wrote: > When I clone git://git.debian.org/git/turqstat/turqstat.git using the > msys-Windows version of git (1.5.4-rc2), some but not all the files > get > autoconverted to CRLF. Is it possible to set properties for the files > that are text, to make sure they are converted properly? Per default, CRLF conversion is disabled in msysgit. Git should not convert a single file. Does it really convert some? You can verify that CRLF conversion is off by running git config core.autocrlf which should just print an empty line. You can enable automatic conversion for all text files by running git config core.autocrlf true (this can be set on a per-repository basis or you can set a default for your account if you pass the '--global' option.) A difficulty you'll run into is that you need to set "core.autocrlf true" before you checkout. But because git clone fuses git init, git fetch, and git checkout into a single operation, you can't use it as is if you like to enable CRLF on a per-repository basis (it works if you set a global default). You can either use git clone -n URL # -n tells clone to stop before checkout cd turqstat git config core.autocrlf true git checkout -b master origin/master or you can manually do what clone would do for you, i.e. mkdir turqstat cd turqstat git init git config core.autocrlf true git remote add origin git://git.debian.org/git/turqstat/ turqstat.git git fetch origin git checkout -b master origin/master (this is what I typically do). BTW, I think that git clone should be improved to avoid the workaround described above. Maybe it could ask the user if it should set up a specific line ending conversion before checkout. Unfortunately, I had no time to write a patch, yet. Steffen