"Updating the Git index failed" error - how to get rid of it?

3,147 views
Skip to first unread message

Arkadiusz Piekarz

unread,
Oct 3, 2009, 11:57:00 AM10/3/09
to msysGit
I started working on a new project and each time I try to add a file
into the staging area, I get an error:

"Updating the Git index failed. A rescan will be automatically started
to resynchronize git-gui.
warning: CRLF will be replaced by LF in <file name>
Unlock Index / Continue"

How can I get rid of it? I tried adding autocrlf = input (int the Core
group) in my repository .git/config file, but it didn't help. I'm
working on QtCreator on Windows XP SP3.

Arkadiusz Piekarz

unread,
Oct 10, 2009, 3:55:19 PM10/10/09
to msysGit, alis...@alibrightman.com
> Just a thought... do you have Gnu coreutils installed, or any
> "nice.exe" in the path? Git Gui attempts to run some Git tools via
> nice.exe, which isn't supported on Windows. nice.exe returns a failure
> code, which Git Gui seems to interpret as the return code of the tool.

> See also:
> http://groups.google.com/group/msysgit/browse_thread/thread/548925418bbf00f6/44b6d9d743226d46?hl=en&lnk=gst&q=alibrightman#44b6d9d743226d46

> Cheers
> Alistair

I don't think I have installed GNU Coreutils in the past. I scanned my
disk to be sure and haven't found any nice.exe file. There is also no
nice.exe in the PATH variable. Here is my PATH:

%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;C:
\Program Files\Alky for Applications\Libraries\;C:\Program Files\ATI
Technologies\ATI.ACE\Core-Static

Anyway, thanks for trying to help.

Cheers,
Arek

Pat Thoyts

unread,
Oct 10, 2009, 7:13:45 PM10/10/09
to Arkadiusz Piekarz, msysGit
2009/10/3 Arkadiusz Piekarz <piekarza...@gmail.com>:

As far as I can tell from this happening to me recently, you get this
when you have a text file with unix line-endings in your local working
directory. It is just warning you that it will convert to crlf line
endngs when it commits to the repository. If you force a checkout of
the file I suspect this will clear up automatically. If the file needs
to remain unix line endings then edit .gitattributes to include this
file path and -crlf to prevent automatic line ending conversion.

Arkadiusz Piekarz

unread,
Oct 11, 2009, 12:28:04 PM10/11/09
to msysGit, patt...@googlemail.com, alis...@alibrightman.com


On 11 Paź, 01:13, Pat Thoyts <pattho...@googlemail.com> wrote:
> 2009/10/3 Arkadiusz Piekarz <piekarzarkadi...@gmail.com>:
>
> As far as I can tell from this happening to me recently, you get this
> when you have a text file with unix line-endings in your local working
> directory. It is just warning you that it will convert to crlf line
> endngs when it commits to the repository. If you force a checkout of
> the file I suspect this will clear up automatically. If the file needs
> to remain unix line endings then edit .gitattributes to include this
> file path and -crlf to prevent automatic line ending conversion.

Frankly, the problem is the opposite of what you just said.

I have lots of text files with windows-style line-endings (CRLF). Gitk
is
warning me that it will convert from CRLF to LF (NOT from LF to CRLF),
because this is what I configured it to do (BTW I'm working on
Windows).

What I want it to do is to NOT DISPLAY THE WARNING each time I try to
add
a modified file into the staging area, because I know it will do it
anyway.

How can I remove that warning without changing the behaviour, so that
in
the end I will get files with LF line-endings but without any warnings?

Pat Thoyts

unread,
Oct 11, 2009, 3:20:18 PM10/11/09
to Arkadiusz Piekarz, msysGit, alis...@alibrightman.com
2009/10/11 Arkadiusz Piekarz <piekarza...@gmail.com>:

> What I want it to do is to NOT DISPLAY THE WARNING each time I try to
> add
> a modified file into the staging area, because I know it will do it
> anyway.
>
> How can I remove that warning without changing the behaviour, so that
> in
> the end I will get files with LF line-endings but without any warnings?

Looking cache.c it seems the warning is controlled by the checksafe
variable which can be one of SAFE_CRLF_FALSE, SAFE_CRLF_FAIL,
SAFE_CRLF_WARN
This appears to be set from core.safecrlf (in config.c).
So I reckon if you set core.safecrlf to false it will silence the warnings.
(I have not tried this yet).

Arkadiusz Piekarz

unread,
Oct 11, 2009, 4:42:38 PM10/11/09
to msysGit, patt...@googlemail.com, alis...@alibrightman.com


On 11 Paź, 21:20, Pat Thoyts <pattho...@googlemail.com> wrote:
> 2009/10/11 Arkadiusz Piekarz <piekarzarkadi...@gmail.com>:
Thanks, that was exactly what I was looking for! :-)
The file that needed to be modified was repository_name/.git/config
Reply all
Reply to author
Forward
0 new messages