最近我们经常将SVG文件添加到我们的Git存储库中。问题是SVG文件差异很难看到GitHub上的其他差异。
差异就像这样
+ <path class="st3" d="M179.7,29l-0.6-4c-0.1-0.7,0-1.3,0.4-2c1.5-2.8,2.6-6.2,3.4-10.3c0-0.3,0.2-0.5,0.4-0.6s0.5-0.2,0.8-0.1
+ l2.1,0.6c0.3,0.1,0.5,0.2,0.7,0.5s0.2,0.5,0.2,0.8c-0.3,2.2-0.8,4.2-1.4,6c0,0.1-0.1,0.2-0.1,0.3v18c0,0.3-0.1,0.6-0.3,0.8
+ c-0.2,0.2-0.5,0.3-0.8,0.3h-2.1c-0.3,0-0.6-0.1-0.8-0.3c-0.2-0.2-0.3-0.5-0.3-0.8V27.7c0-0.1,0-0.1-0.1,0c-0.5,0.9-0.8,1.4-0.8,1.5
+ c-0.1,0.2-0.2,0.2-0.4,0.2C179.8,29.3,179.7,29.2,179.7,29z M207.8,26.7c0,0.3-0.1,0.5-0.3,0.8c-0.2,0.2-0.5,0.3-0.8,0.3h-0.4
+ c0,0,0,0-0.1,0.1c0,0,0,0.1,0,0.1c0.1,0.1,0.4,0.6,0.9,1.4c0.2,0.3,0.2,0.5,0.2,0.8c0,0.3-0.2,0.5-0.4,0.7l-0.9,0.7
+ c-0.2,0.2-0.5,0.2-0.7,0.2c-0.3-0.1-0.5-0.2-0.6-0.5c-0.3-0.5-0.8-1.3-1.6-2.3c0,0-0.1,0-0.1,0c-0.2,0.6-0.7,0.9-1.4,1
+ c-0.7,0.1-2.2,0.2-4.4,0.2h-1.1c-0.1,0-0.2,0-0.2,0.1c0,0-0.1,0.1-0.2,0.2s-0.2,0.1-0.2,0.2c-0.1,0.1-0.1,0.1,0,0.1h8
+ c0.3,0,0.6,0.1,0.8,0.3c0.2,0.2,0.3,0.5,0.3,0.8V32c0,0.8-0.3,1.3-0.8,1.8c-0.5,0.5-1.1,0.9-1.8,1.3c0,0,0,0.1,0,0.1
+ c1.6,0.2,3.3,0.4,5.1,0.5c0.3,0,0.5,0.1,0.7,0.3s0.2,0.5,0.2,0.7l-0.4,1.5c-0.1,0.3-0.2,0.5-0.5,0.7c-0.2,0.2-0.5,0.2-0.9,0.2
+ c-3.2-0.3-6.2-0.9-9-1.9c-0.1,0-0.2,0-0.3,0c-2.7,0.9-5.6,1.5-8.8,1.9c-0.3,0-0.6,0-0.8-0.2c-0.3-0.2-0.4-0.4-0.5-0.7l-0.4-1.4
我们希望将SVG文件跟踪为图像,但GitHub将其差异显示为文本。 有什么方法可以自动隐藏这些SVG文件差异?或者将它们显示为默认图像的方式?
答案 0 :(得分:2)
GitHub没有提供任何方法来忽略差异中的某些文件。也许有一天(发送功能请求!)他们将按照for images的方式构建一个SVG查看器。
与此同时,如果您还将SVG的呈现副本存储在存储库中,则至少可以获得两个视图。还可以to HBHB来推荐Github diff helper和Github Collapse Diff Chrome扩展程序。只是将它们从评论中拉出来以获得更好的可见性。