{"thread":{"id":"24252","subject":"Forcing CRLF for files in a directory","startedAt":"2010-07-01T12:12:52Z","lastAt":"2010-07-01T13:55:00Z","messageCount":3,"participants":["Ryan McCue","Eyvind Bernhardsen","Finn Arne Gangstad"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"144587","messageId":"4C2C8644.4060208@ryanmccue.info","threadId":"24252","inReplyTo":null,"subject":"Forcing CRLF for files in a directory","fromName":"Ryan McCue","fromEmail":"me@ryanmccue.info","sentAt":"2010-07-01T12:12:52Z","receivedAt":"2010-07-01T12:12:52Z","isPatch":false,"sender":{"key":"me@ryanmccue.info","avatar":null},"body":"Hi there,\n\nI'm working on a project at the moment which stores raw HTTP header data \nalong with bodies for use during testing. As each header line must be \nseparated by a CRLF, these need to remain so in the repository.\n\nMy question is: Do I need to do anything special to ensure these CRLFs \naren't converted to LFs during checkout?\n\nThanks,\nRyan.\n"},{"id":"144591","messageId":"84784AAD-6276-4736-A04C-EDF55986C346@gmail.com","threadId":"24252","inReplyTo":"4C2C8644.4060208@ryanmccue.info","subject":"Re: Forcing CRLF for files in a directory","fromName":"Eyvind Bernhardsen","fromEmail":"eyvind.bernhardsen@gmail.com","sentAt":"2010-07-01T13:37:03Z","receivedAt":"2010-07-01T13:37:03Z","isPatch":false,"sender":{"key":"eyvind.bernhardsen@gmail.com","avatar":"https://avatars.githubusercontent.com/u/106762?v=4"},"body":"On 1. juli 2010, at 14.12, Ryan McCue wrote:\n\n> Hi there,\n> \n> I'm working on a project at the moment which stores raw HTTP header data along with bodies for use during testing. As each header line must be separated by a CRLF, these need to remain so in the repository.\n> \n> My question is: Do I need to do anything special to ensure these CRLFs aren't converted to LFs during checkout?\n\nNo.  As long as you don't set any attributes, git will by default leave your line endings alone on Linux.\n\nYou might get into trouble on Windows, because git defaults to converting line endings to CRLF on checkout (core.autocrlf=true) and gets confused when files are already checked in with CRLFs.  This problem is fixed in the upcoming 1.7.2 release.\n-- \nEyvind\n"},{"id":"144592","messageId":"20100701135500.GA20015@pvv.org","threadId":"24252","inReplyTo":"4C2C8644.4060208@ryanmccue.info","subject":"Re: Forcing CRLF for files in a directory","fromName":"Finn Arne Gangstad","fromEmail":"finnag@pvv.org","sentAt":"2010-07-01T13:55:00Z","receivedAt":"2010-07-01T13:55:00Z","isPatch":false,"sender":{"key":"finnag@pvv.org","avatar":"https://gravatar.com/avatar/b421ddd58c3f0f93aa473e17b98bb8d53c221fef741746bc8cb59fae4ec6d95e?d=mp&s=160"},"body":"On Thu, Jul 01, 2010 at 10:12:52PM +1000, Ryan McCue wrote:\n> Hi there,\n>\n> I'm working on a project at the moment which stores raw HTTP header data  \n> along with bodies for use during testing. As each header line must be  \n> separated by a CRLF, these need to remain so in the repository.\n>\n> My question is: Do I need to do anything special to ensure these CRLFs  \n> aren't converted to LFs during checkout?\n\nIf you are working on Windows and have set autocrlf (default on in\nmsysgit), they will be converted to LF only in the repo if they are\nauto-detected as text files, and will get LF when checked out on a\nsystem with autocrlf false.\n\nYou can force autocrlf to not think of a file as a text file by\nsetting \"-crlf\" for that file in .gitattributes.\n\nIn the upcoming 1.7.2 release, autocrlf has been fixed to never\nautodetect files with mixed line endings in the repository as text\nfiles, but it will take considerable time before that version is used\neverywhere I guess. Also, this won't really help you if you create the\nfiles on Windows.\n\n- Finn Arne\n"}]}