gpt4 book ai didi

git - 当我在 Windows 7 中保存时,git diff 显示所有带有 ^M 的行

转载 作者:太空狗 更新时间:2023-10-29 12:59:27 26 4
gpt4 key购买 nike

我使用 Ubuntu 将存储库上传到 github。

我下载到 Windows 7 并使用 msysgit。当我在 Windows 中保存一些文件时没有任何更改。

当我执行 git status 时,它们被列为已修改。

当我执行 git diff 时,所有行的末尾都有 ^M。

这是什么 ^M,我该如何忽略它?

提前致谢。

更新

我在 .gitconfig 中有 autocrlf = false,因为我想保留 lf 而不是 auto 或 crlf。

最佳答案

尝试使用autocrlf git 配置中的选项。

git config core.autocrlf true

关于git - 当我在 Windows 7 中保存时,git diff 显示所有带有 ^M 的行,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6081455/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com