I am using Git gui. I see this error for several files in a folder. I have two choice buttons - Unlock index
and Continue
. I don't understand what the buttons do. I saw other SO posts which tell
me to ignore the warning, but they don't mention how to do it in GUI. Please tell me which button I should press and why.
Thanks.
Here is the error message sample -
Updating the Git index failed. A rescan will be automatically started to resynchronize git-gui.
warning: LF will be replaced by CRLF in gen/com/click4tab/pustakalpha/BuildConfig.java. The file will have its original line endings in your working directory. (repeat above messages for other files)
This isn't an error, simply a warning that the files that will be committed are different than the files you saved. The default behavior for git on windows is to convert LF to CRLF, because some editors in Windows don't know how to handle LF (e.g. Notepad would ignore them and display everything as one line of text).
Fix LF Will Be Replaced by CRLF Warning in Git If you wish to use the project under Windows only, the flag should be set to false . However, in Unix-based OS, you can disable the core. autocrlf per our need. The command will give output of true or false or input , and you can make changes according to your need.
This is a good default option. text eol=crlf Git will always convert line endings to CRLF on checkout. You should use this for files that must keep CRLF endings, even on OSX or Linux. text eol=lf Git will always convert line endings to LF on checkout.
CR = Carriage Return ( \r , 0x0D in hexadecimal, 13 in decimal) — moves the cursor to the beginning of the line without advancing to the next line. LF = Line Feed ( \n , 0x0A in hexadecimal, 10 in decimal) — moves the cursor down to the next line without returning to the beginning of the line.
Set up the CRLF and the problem will "disappear"
# Option 1:
git config --global core.autocrlf false
# Option 2:
`git config --global core.safecrlf false`
https://help.github.com/articles/dealing-with-line-endings
It is not autocrlf
matters, but safecrlf
. Use below command to suppress the warnings.
git config --global core.safecrlf false
autocrlf
is to control whether transform line endings when add
/checkout
, while safecrlf
is to control whether warn users when doing such transformations.
Soo, i'm have that problem too. I fix it, simple, using by IDE.
Use IDE (intellij idea).
And then after use IDE.. no problem)
To add onto @Code Wizard's solution here: https://stackoverflow.com/a/24770798/19037789 ,
You can also run the following command to set your CRLF locally, only to the specific project you're working on:
git config --local core.autocrlf false
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With