4

I'm trying to do something very simple: check out a repo that has CRLF endings (and no .gitattributes) file, and end up with native (LF) line endings. I don't even want to commit back.

I've read Github's suggestion, and Tim Clem's article, but mostly they seem aimed at Windows developers.

I've tried this:

$ git config --global core.autocrlf=input $ git clone https://github.com/DennisSchiefer/Project-OSRM-Web.git 

But no - the file I care about, OSRM.Config.js, still has CRLF endings.

Trying core.autocrlf=true didn't help.

Even adding and committing a .gitattributes file (then git rm --cached -r . && git reset --hard) doesn't help.

I can't find any combination that will actually leave LF line endings on this file.

1 Answer 1

1

core.autocrlf will force git to process all text files.

If OSRM.Config.js is not processed, that means Git deems it binary.
See:

Even with a .gitattributes with *.js text, that would still keep crlf.

But with *.js eol=lf, that would actually force the conversion.

See "Can git's .gitattributes treat all files as binary except a few exceptions?".

Sign up to request clarification or add additional context in comments.

4 Comments

Amongst other lines in my .gitattributes: *.js text
@SteveBennett text means crlf diff, like binary means -crlf -diff (stackoverflow.com/a/4264522/6309) matbe try *.js text lf diff?
@SteveBennett or *.js eol=lf
@SteveBennett great. I have included my comments in the answer for more visibility.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.