git - git shows mysterious changes
问题描述
I'm facing this issue constantly when working in a team. Every time I push changes, there are some changes that weren't made by me, and I can't seem to understand what has changed. I attached an example screenshot from Fork.
You can see there are tiny character highlighted at the end of line 64. The file has LF line ending format, and I don't think it is mixing it with CRLF.
The team uses different OS and IDE's
Note: the highlighted character is not a space. I can't post the text here as it get reformatted by SO.
解决方案
我可以是行尾空格或换行符。例如,也许他们在括号之后添加了(意外)空格,并且他们的编辑器不会自动修剪它们,而您的编辑器可能被配置为修剪它们,使它们消失,创建更改。
您应该真正与您的团队同步以使用相同的编辑器设置(换行符的类型、修剪行尾等)以避免出现此类情况。
推荐阅读
- reactjs - 如何向 Material-UI Select 添加图标?
- jsf - 下载后无法更新组件
- reactjs - 在 NextJS 应用程序中使用 nginx 提供动态路由
- next.js - NextJS CSRF 和隐藏公共机器的路由
- regex - 如何将匹配器对象转换为 groovy 中的字符串
- reactjs - ReactJS TypeError:无法读取未定义的属性(读取“地图”)
- c# - 在 C# 控制台应用程序中使用 HttpClient 上传文件
- javascript - window.URL.createObjectURL 设置文件名以在新选项卡中打开 pdf
- c++ - 使用智能指针将“this”传递给类的最佳实践
- xcode - Flutter build_runner 命令创建重复的文件和文件夹