git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Unexpected difference between core.autocrlf=true and .gitattributes text=auto
@ 2014-03-19 13:44 Marc Strapetz
  0 siblings, 0 replies; only message in thread
From: Marc Strapetz @ 2014-03-19 13:44 UTC (permalink / raw)
  To: git

I have a file.txt which is stored with CRLF in the repository (I'm on
Windows, but that should not matter). autocrlf has been set:

$ git config core.autocrlf
true

Git considers the working tree clean:

$ touch file.txt
$ git status
On branch master
nothing to commit, working directory clean

However, when adding .gitattributes with following content:

* text=auto

Git starts considering the file as modified:

$ touch file.txt
$ git status
On branch master
Changes not staged for commit:
...

        modified:   file.txt

I think it's correct to consider the file as modified, because when
committing it, it should be converted to CRLF.

But why doesn't it show up as modified in the first case?

-Marc

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2014-03-19 13:53 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-03-19 13:44 Unexpected difference between core.autocrlf=true and .gitattributes text=auto Marc Strapetz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).