Fix warning: LF will be replaced by CRLF | GIT

preview_player
Показать описание
This tutorial will help you to get rid of GIT warning: LF will be replaced by CRLF

This happens when developers are working in multiple operating systems. Line breaks are treated differently in different operating systems, therefore, GIT throws warning before converting the LF line endings with CRLF.

I've explained 2 methods of fixing it:

1) Running a command through the terminal for the currently working user
2) Making a global change so that no user gets this warning

#GIT #CRLF #LF
Рекомендации по теме
Комментарии
Автор

Thank you Sir.Very rarely we can find this type informative videos.Thanks for this video.

lakshmidevilakshmidevi
Автор

I got the same error. I tried this fix but did not work. What seemed to work for me was I had made a folder in my repository to contain all the bad programs I had written (OPC is a beast to learn). After I relocated those files to an area not within my repository, my changes committed without a problem.

daveandhootiefan
Автор

Hello Code SOS!! I've followed the 1st step and the warning still appears, why do you think this happens?

albertoi.cruzgalvan
Автор

Does this allow mac/windows users to see CRLF and LF as the same or will this ONLY remove the warning error? Currently when i do file comparison it shows as different file sizes.

chriscullen
Автор

Although running that command still getting this error on windows os
"LF will replace by CRLF next time ". could you please assist me in this please

yarramneediravindraswamy
Автор

Hiii code sos ! I have followed ur second method and I got result without error .And then I added ".gitattributes " by using git add, then I am trying to add another file it's is showing the same error soo can u pls explain me y it happend

pullarekhasri
Автор

Hello sir Iam new at coding I was uploading my website through github and when I commit this errors are coming pls help me how Can I solve that?

pragu
Автор

i got this error when i was uploading my project on github but i am getting this error only in ".SVG" image files so what to do ???
edit - shoudl i include them as binary or what to do ???please help

ujjawaltyagi
Автор

bro so you are saying whenever we are into new folder project we have to create this file everytime😐😭😭.

IllIIIIIIllll
Автор

hi thanks for posting this video although i am very confused by this since i saw the same code elsewhere with the ending written false instead of true and now im quite confused ...maybe you could assist me there

khaishir
Автор

"git config --global core.autocrlf true" never seems to work for me, but it looks like the .gitattributes file may have done the trick. Thanks!

hthrun
Автор

the video was helpful.
but I don't have a .git file in the working folder
will the following command work
git checkout-index --force --all

vidhyanandcs