Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

There is nothing changed, but eclipse egit marks the file as changed

Tags:

git

egit

I'm using eclipse egit with github. I found something strange that I didn't change anything, but egit marked the file as "changed". See the images:

  1. the file "run.bat" is marked as "changed"

    enter image description here

  2. Compare with "file in Git index", you can see nothing is different

    enter image description here

  3. Compare with "file in HEAD", you can see nothing is different neither

    enter image description here

My friend uses mac and I use windows, but we all configured git as "commit unix lineend".. I also checked the lineend of my source and the HEAD, they are the same(I configured git to convert them to "\r\n" when pulling)

Where is wrong? Is it a bug of Egit?

like image 802
Freewind Avatar asked Nov 22 '11 13:11

Freewind


2 Answers

Eclipse Preferences / Team / Git / Configuration / User Settings

("core" section)

key: autocrlf
value: false

The key should already exist, so just need to edit the value.

If creating a new key then use core.autocrlf.

like image 149
Mark Avatar answered Nov 01 '22 15:11

Mark


One of the first things I've had issues with in Git.

I've said this forever:

git config --system core.autocrlf false

To get rid of CR highlighting in diff and patch views, use:

git config --system core.whitespace cr-at-eol

If you share your computers with others, replace '--system' with '--global'.

like image 48
Adam Dymitruk Avatar answered Nov 01 '22 13:11

Adam Dymitruk