Ancient git repo vs modern git cloned copy, CRLF vs LF line endings -


if duplicate, please point me it.

the problem confronted after cloning repository, git status says huge number of files have changed. haven't changed thing; cloned repo. problem crlf vs lf line endings.

relevant facts:

  • the repo on unix machine runs ancient version of git, version 1.7.1.

  • the repo populated via eclipse plug-in machine uses crlf line endings , has modern version of git (exact version number unknown).

  • my machine uses lf line endings , has modern version of git, version 2.3.0.

all text files have crlf line endings when clone repo. that's fine; machine can respect that. isn't fine git status says every text file has been changed. unacceptable; haven't changed thing (yet).

i have control on git config , git attributes on machine , on repo machine. don't have control on version of git on repo machine, or on how git used on machine uses crlf line endings.


the question:
settings, either locally or on repo, enable me clone repo , have git status nothing has changed?


update:
please don't tell me to:

  • use git config --global core.autocrlf <value>
    please don't tell me 2 reasons.

    one reason if did work, not solution want. of use cases involve people use machines use lf rather crlf line endings. somehow, nasty crlf line endings manage sneak way in (this big problem subversion). modern versions of git snip problem in bud. in 1 case, i'm dealing works industry crlf centric. 1 case exception, not rule. please not tell me use git config --global handle special case.

    the other reason doesn't work. i've tried that. i've tried lots of things, git status | grep modified: | wc -l being large number. should zero.

if global or local core.autocrlf setting not getting results want, can set git line ending attribute , force result looking for.

# set eol conversions on text-based files 'nothing' echo '* text' >> .gitattributes # force git re-scan dir rm .git/index git reset # review current files git status 

note: eol setting be:

* text=auto 

Comments

Popular posts from this blog

toolbar - How to add link to user registration inside toobar in admin joomla 3 custom component -

linux - disk space limitation when creating war file -