如何在使用WinMerge作为扩散工具时忽略“代码样式”的更改?特别是两次提交。
所以
thing
{
a,
b
}和
thing { a, b }将被视为完全相同。
本质上是这问题,但是对于winmerge而不是diff。
.gitconfig
[diff]
tool = winmerge
[difftool]
prompt = false
[difftool "winmerge"]
cmd = "$HOME/scripts/winmerge.sh" "$LOCAL" "$REMOTE"
[mergetool]
prompt = false
keepBackup = false
keepTemporaries = false
[merge]
tool = winmerge
[mergetool "winmerge"]
cmd = "'C:/Program Files (x86)/WinMerge/WinMergeU.exe'" -e -u -fm -dl \"Local\" -dr \"Remote\" "$LOCAL" "$MERGED" "$REMOTE"(winmerge.sh刚刚调用WinMergeU.exe -e -u -wr "$1" "$2")
似乎没有一个命令行选项适合,我认为行过滤器不能工作,因为它们是每一行。
发布于 2021-02-14 22:53:09
这个选项适用于我:
WinMerge ->编辑-> Options -> -> General:忽略空行;忽略回车差异(Windows/Unix/Mac)
等。
答案是从https://superuser.com/questions/174275/can-i-compare-only-file-contents那里得到的
发布于 2020-07-09 23:45:26
您可以为您的文件添加一个.gitattributes。这将运行一个工具来规范/美化/美化两个文件,然后再进行比较。
这将在比较之前通过.json文件通过json_pp运行:
echo "*.json diff=json" >> .gitattributes
git config diff.json.textconv json_pp查看git文档以获得详细信息:https://git-scm.com/docs/gitattributes
来源:https://t-a-w.blogspot.com/2016/05/sensible-git-diff-for-json-files.html
https://stackoverflow.com/questions/62825020
复制相似问题