0

I have a maven file mvnw.cmd in the unstaged files, BUT there are no real modification. It looks to me, it has something to do with EOL, because every line has been marked to remove and add.

enter image description here

I tried already to delete and get out it again from GIT. I tried to stash it, but it still remains as unstaged file.

The .gitattributes file:

# Auto detect text files and perform LF normalization
*   text=auto

# Make sure that the line ending style ist set to Linux for shell scripts
*.sh        eol=lf


# Make sure that the line ending style ist set to Windows for bat scripts
*.bat       eol=crlf
*.cmd       eol=crlf

Thank you in advance.

Gerhard
  • 22,678
  • 7
  • 27
  • 43
Michael Hegner
  • 5,555
  • 9
  • 38
  • 64
  • Okay but what kind of line endings does that file have in the repository? Use `hexdump` or some editor that will display line endings or hex. It probably has incorrect line endings in the repository, which needs to be corrected in addition to your `gitattributes`. – Edward Thomson Nov 08 '17 at 09:25

2 Answers2

0

Don't understand why, but after update of GIT itself everything is fine.

Git old was 2.9.0 Git new is 2.15.0

Issue gone.

Michael Hegner
  • 5,555
  • 9
  • 38
  • 64
0

This could be due to how Git converts line endings based on the value of core.autocrlf. Checkout this question for an explanation: https://stackoverflow.com/a/20653073/4522186

Randy Leberknight
  • 1,363
  • 9
  • 17