git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: Forcing CRLF for files in a directory

From
Eyvind Bernhardsen <eyvind.bernhardsen@gmail.com>
Date
Jul 1, 2010, 13:37 UTC
Message-ID
<84784AAD-6276-4736-A04C-EDF55986C346@gmail.com>
In-Reply-To
<4C2C8644.4060208@ryanmccue.info>
On 1. juli 2010, at 14.12, Ryan McCue wrote:
Show 5 quoted lines
> Hi there,
> 
> 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.
> 
> My question is: Do I need to do anything special to ensure these CRLFs aren't converted to LFs during checkout?
No.  As long as you don't set any attributes, git will by default leave your line endings alone on Linux.
You 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.
-- 
Eyvind
Previous: Ryan McCueNext: Finn Arne Gangstad
Message 2 of 3 in “Forcing CRLF for files in a directory”
  1. Ryan McCueJul 1, 2010
  2. Eyvind BernhardsenJul 1, 2010
  3. Finn Arne GangstadJul 1, 2010

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.