2

Everytime i add a new image to my project, Git convert CRLF to LF. It would be okay if the files came from windows, but it does not, I'm on Debian ! The files i'm getting from "pull" on my remote server are then corrupted =/

edi9999
  • 19,701
  • 13
  • 88
  • 127
Shakealot
  • 133
  • 10

3 Answers3

9

Use a .gitattributes file, where you put :

*.png binary

But it is quite strange that it isn't the case by default .

Maybe you use some other uncommon image format ?

edi9999
  • 19,701
  • 13
  • 88
  • 127
7

My problem was the .gitattribute file contained the line * text eol=lf which converted all files to text, including images. When changing the line to * text=auto eol=lf, git automatically detects whether a file is a binary and doesn't touch its line endings.

Elektropepi
  • 1,115
  • 1
  • 13
  • 22
1

In my case,there's a .gitattribute file with content * text=auto eol=lf. after add edi9999's answer(*.png binary), perfect.

hatanooh
  • 3,891
  • 1
  • 14
  • 9