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

Re: Git Config Question

From
Eyvind Bernhardsen <eyvind.bernhardsen@gmail.com>
Date
Aug 2, 2010, 19:13 UTC
Message-ID
<2BD00E81-C9E9-4733-8F21-F55B4D6D961D@gmail.com>
In-Reply-To
<20100719055909.GA16276@burratino>
On 19. juli 2010, at 07.59, Jonathan Nieder wrote:
Show 9 quoted lines
> Shilpa Kulkarni wrote:
> 
>> 2. Person Y checks in code (commit & push). Checks in file a, b.
>> 
>> 3. Person X does a 'git pull origin master'.
>> 
>> Pull succeeds - however
>> 'git status' shows file a, b as modified even though person X has done
>> nothing with these files.
Sorry for the late reply.
The problem is that the files are checked in to the repository with CRLFs intact, but then checked out in a repository that has autocrlf enabled.  The result is that git wants to convert the files to LF, and shows them as modified even though no actual changes have been made.
This no longer happens with git 1.7.2: autocrlf will not convert files that contain CRLFs in the repository.  To enable forced conversion of text files containing CRLF with 1.7.2 or later, add this line to .gitattributes:
	*	text=auto
Files that need conversion (a and b in your example) should be checked in in the same commit as the change to .gitattributes.  gitattributes(5) has a recipe for making sure all files are converted.
Eyvind
Previous: Jonathan Nieder
Message 3 of 3 in “Git Config Question”
  1. Shilpa KulkarniJul 19, 2010
  2. Jonathan NiederJul 19, 2010
  3. Eyvind BernhardsenAug 2, 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.