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

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”

  2. How to make eclipse remember ssh key passphrase?
  3. Eclipse create git repository failure
  4. EGit - fetch, merge, pull troubles
  5. Eclipse Run Configuration - Working Directory for projects not in workspace
  6. Eclipse, Git and Bitbucket - Can't push - Error 401 Unauthorized
  7. Deleting a remote branch with Egit
  8. enter image description here

  9. Compare with “file in Git index”, you can see nothing is different

    enter image description here

  10. 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?

  • Undo a git merge (hasn't been pushed yet)
  • How to fix “refusing to merge unrelated histories” when uploading project to github?
  • Isn't it strange to have branches for totally unrelated code with master?
  • Identifying commits that introduced lots of files
  • git diff output only changed lines
  • Git removing deleted files from tracking
  • 6 Solutions collect form web for “There is nothing changed, but eclipse egit marks the file as changed”

    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’.

    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.

    As a follow up, as I just ran into the same issue, another reason for EGit detecting all files as changed is a POSIX file permission problem at least when used together with Cygwin’s git.

    The following will fix that; however keep in mind that this also means that they are ignored then:

    $ git config core.filemode false

    For eclipse specific issues for linefeed, you can also change the return character in Eclipse Preferences where you can change the New text file line delimiter from Windows syntax to Unix which should help.

    Eclipse Next File Line Delimiter settings

    you can ignore whitespace differences with Eclipse settings under Compare/Patch.
    Preferences–>General–>Compare/Patch,you can find the “Ignore white space” in the right,and select this option.

    In General->Workspace. Select Text encoding UTF-8

    Git Baby is a git and github fan, let's start git clone.