eis
eis

Reputation: 53462

Git: Default all text files to unix line breaks

I know there is setting in .gitattributes to have

*.txt eol=lf

and there is also this to have all text files default to conversion:

* text=auto

However, when I tried to have all my text files as unix-line endings, I noticed this doesn't do anything:

* text=lf

And this changes also binaries:

* eol=lf

so how to have only text files and all text files with unix line ends?

EDIT: this can be done by setting core.eol setting. I was hoping to do it with just .gitattributes, is that possible?

Upvotes: 3

Views: 1983

Answers (1)

Dmitry Pavlenko
Dmitry Pavlenko

Reputation: 8958

Try this

* text=auto !eol

and set core.eol=lf in .git/config.

(the answer is edited, before I proposed one more option "* text=auto eol=lf" but it doesn't work for this case)

Upvotes: 2

Related Questions