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

I used Ubuntu to download the repository on github.

I downloaded on Windows 7 and used msysgit. When I saved some files in Windows without any changes.

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

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

What is ^ M and how can I ignore this?

Thanks in advance.

UPDATE

I have autocrlf = false in .gitconfig because I want to save lf, not auto or crlf.

+7
source share
2 answers

Try using the autocrlf parameter in git config.

git config core.autocrlf true 
+7
source

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

The following should fix this:

 git config --global core.autocrlf true 

Similar question here

+3
source

All Articles