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 =/
Asked
Active
Viewed 1,570 times
3 Answers
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
-
Windows font maybe ! – Shakealot Feb 09 '16 at 10:08
-
Perfect. I renamed the corrupted files directory so git detect the modifications. Thanks – Shakealot Feb 09 '16 at 10:20
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
-
I mistakenly assumed that the default value would be auto, thank you for the clarification! – Justin C. Feb 16 '23 at 16:26
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