0

I cloned a friend's project. I haven't done any modifications and I already have tons uncommitted changes for all project files! For each file, it's as if I simply cut and paste all the contents, but I never did this, and even if I did it, there are no changes.

I tried to sync, but the uncommitted changes stay here forever anyway, so it makes tons of conflicts because, each time I push my changes, I also change all project files.

An exemple of these nonsense commits:

- Azerty
- Hello
- Codes
+ Azerty
+ Hello
+ Codes

Git always does this to all the code in all the tracked files; even after a sync, the uncommited changes appear again.

How to fix it? Why it this happening?

jub0bs
  • 60,866
  • 25
  • 183
  • 186
sylvain1264
  • 855
  • 2
  • 8
  • 23
  • 2
    Take a look at this question: http://stackoverflow.com/questions/6134066/git-diff-command-showing-entire-file-is-modified-instead-of-showing-modified-sma – Sascha Wolf Feb 20 '15 at 11:54
  • Check the following things in the files in question: a) Encoding (Unix/Windows), b) Line Endings (LF or CRLF), c) Whitespace (in case your editor automatically changes these). – nwinkler Feb 20 '15 at 12:15

1 Answers1

0

See https://help.github.com/articles/dealing-with-line-endings/

Mac: git config --global core.autocrlf input

Windows: git config --global core.autocrlf true

Linux: git config --global core.autocrlf input

Anthony Hatzopoulos
  • 10,437
  • 2
  • 40
  • 57