[英]How can I use my own diff tool with `add --patch` and the like?
我使用一個名為diffr的另類差異工具,如下所示:
diffr="diffr \
--colors removed:background:00:foreground:01 \
--colors refine-removed:background:0:foreground:124 \
--colors added:background:0:foreground:10 \
--colors refine-added:background:0:foreground:35:intense \
| less -R"
git config --global pager.diff "$diffr"
git config --global pager.show "$diffr"
git config --global pager.log "$diffr"
在添加和簽出代碼時,我的正常工作流程也通常使用--patch
和--interactive
標志。
但是, --patch
開關似乎使用默認值(colordiff?)而不是 diffr。
在這種情況下(以及我可能沒有想到的任何其他工具),我如何強制 diffr 作為 diff 工具?
有時,要找到答案,您所要做的就是提出問題。
解決方案是:
git config --global interactive.diffFilter "$diffr"
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.