GitHub - 为什么两条线被标记为不同而没有任何明显差异?
GitHub - why two lines are marked as different without any visible differences?
如您所见,index.html 中的第 1 行已标记为已更改:
但据我所知,没有一个字符发生变化。取决于 GitHub 还是 Git?是 bug 还是某些隐藏角色被更改了?
删除的行末尾似乎有一个空格。
是的,那里有一个隐藏角色,一个UTF8 BOM。
$ git show cba438:index.html | od -c | head -1
0000000 357 273 277 < ! d o c t y p e h t m
$ git show cba438~1:index.html | od -c | head -1
0000000 < ! d o c t y p e h t m l > \n
相关的 SO 问题:What's different between UTF-8 and UTF-8 without BOM?
如您所见,index.html 中的第 1 行已标记为已更改:
但据我所知,没有一个字符发生变化。取决于 GitHub 还是 Git?是 bug 还是某些隐藏角色被更改了?
删除的行末尾似乎有一个空格。
是的,那里有一个隐藏角色,一个UTF8 BOM。
$ git show cba438:index.html | od -c | head -1
0000000 357 273 277 < ! d o c t y p e h t m
$ git show cba438~1:index.html | od -c | head -1
0000000 < ! d o c t y p e h t m l > \n
相关的 SO 问题:What's different between UTF-8 and UTF-8 without BOM?