GIT 提交^M 文件所有行都被修改

 

$ git config --global core.autocrlf true

Of course, this is said to convert crlf to lf, while you want to convert cr to lf. I hope this still works …

And then convert your files:

# Remove everything from the index
$ git rm --cached -r .

# Re-add all the deleted files to the index
# You should get lots of messages like: "warning: CRLF will be replaced by LF in <file>."
$ git diff --cached --name-only -z | xargs -0 git add

# Commit
$ git commit -m "Fix CRLF"

from:

https://stackoverflow.com/questions/1889559/git-diff-to-ignore-m

posted @ 2021-12-21 16:49  愤怒的企鹅  阅读(384)  评论(0编辑  收藏  举报