On Mon, 7 Apr 2014 03:19:34 -0700 (PDT)
Bicen Zhu <zhubi...@gmail.com> wrote:

> > I found something strange, which can be reproduced as below,( at
> > lease at my git repository)
> >
> > there is a working copy which is clean, then i delete one file
> > using 'rm RosterLogoButton.h' command in the Git bash.
> > then using `git checkout  RosterLogoButton.h` to get it back, 
> > here run git status, i can see the file was changed, this is
> > unexpected, and the git diff shows it deleted each of line and
> > added back.
> >
> > during these steps i did't change the end of line setting, and
> > spaces tab etc.
> >
> > here, `git checkout RosterLogoButton.h` is also not working, after
> > running it, git bash still prompt the file is changed.
> >
> > Any comments? 
> >
> > $ git --version
> > git version 1.9.0.msysgit.0
> >
> The issue is related the file under repo: .gitattributes
> when i comment the line below, the issue disappear:
> 
> * text=auto

Yes, you're right.

Setting text=auto in .gitattributes is equivalent to setting
core.autocrlf=input in the Git's configuration.

To cite the gitattributes(5) manual page:

  Set to string value "auto"
  When text is set to "auto", the path is marked for automatic
  end-of-line normalization. If git decides that the content is text,
  its line endings are normalized to LF on checkin.

Now let's cite the git-config(1) manual page:

  core.autocrlf
  Setting this variable to "true" is almost the same as setting the
  text attribute to "auto" on all files except that text files are not
  guaranteed to be normalized: files that contain CRLF in the
  repository will not be touched. Use this setting if you want to have
  CRLF line endings in your working directory even though the
  repository does not have normalized line endings. This variable can
  be set to input, in which case no output conversion is performed.

This is kind of moot so consider reading [1] instead.

1. http://stackoverflow.com/a/20653073/720999

-- 
You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to