7

I used Ubuntu to upload a repository to github.

I downloaded to windows 7 and using msysgit. When I saved some files in Windows without any changes.

When I do git status, they are listed as modified.

When I do git diff, all the line has ^M at the end.

What is this ^M and how can I ignore this?

Thanks in advance.

UPDATE

I have autocrlf = false in .gitconfig, because I want to keep lf rather than auto or crlf.

shin
  • 30,521
  • 65
  • 174
  • 258

2 Answers2

7

Try to use autocrlf option in git config.

git config core.autocrlf true
ceth
  • 42,340
  • 57
  • 170
  • 277
  • why 'git config core.autocrlf true' solve the problem but not 'git config --global core.autocrlf true'? – shin May 21 '11 at 12:02
  • --global apply to your system, without '--global' - current repository – ceth May 21 '11 at 12:09
3

The ^M symbol is the Windows end-of-line encoding.

The following should fix it:

git config --global core.autocrlf true

Similar question is here

Community
  • 1
  • 1
evgeny
  • 2,524
  • 15
  • 27