How to set patience as default git diff algorithm

不打扰是莪最后的温柔 提交于 2019-11-27 01:27:01

问题


In .git/config I tried:

[diff]
    patience = true

But no luck

Do I have to do:

git diff --patience
git show --patience HEAD

etc., every time?


回答1:


Since Git 1.8.2, Git will use diff.algorithm:

git config --global diff.algorithm patience

It took a few iterations:

[PATCH v3 0/3] Rework git-diff algorithm selection

[PATCH v2 0/3] Rework git-diff algorithm selection

[PATCH 0/3] Rework git-diff algorithm selection

[PATCH] diff: Introduce diff.algorithm variable.

[PATCH] config: Introduce --patience config variable




回答2:


In lieu of a config-based answer, you could set an alias in your .gitconfig like so:

[alias]
dp = diff --patience

Which will allow you to do git dp [optional refspec]



来源:https://stackoverflow.com/questions/4460202/how-to-set-patience-as-default-git-diff-algorithm

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!