gpt4 book ai didi

git - 有没有办法在不改变格式的情况下比较 Git 中的两个文件?

转载 作者:行者123 更新时间:2023-12-04 16:31:29 24 4
gpt4 key购买 nike

我已经提交了一些具有某种格式的代码,但起源有一些其他格式。审阅者要求我还原所有更改,我正在寻找一些 UI 工具或 Git 中的某种方法来删除格式并给出实际结果。

最佳答案

我想您可能会查看 git diff,特别是以下两个选项:

-b, --ignore-space-change
Ignore changes in amount of whitespace. This ignores whitespace at line end, and considers all other sequences of one or more whitespace characters to be equivalent.

-w, --ignore-all-space
Ignore whitespace when comparing lines. This ignores differences even if one line has whitespace where the other line has none.

所以运行 git diff --ignore-all-space
但是,如果您通过格式化定义的不仅仅是空格,我想您必须手动完成

关于git - 有没有办法在不改变格式的情况下比较 Git 中的两个文件?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31051346/

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