Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

When I saved in Windows 7, git diff shows all the lines with ^M

Tags:

git

msysgit

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.

like image 911
shin Avatar asked May 21 '11 11:05

shin


1 Answers

Try to use autocrlf option in git config.

git config core.autocrlf true
like image 163
ceth Avatar answered Sep 22 '22 14:09

ceth