gpt4 book ai didi

windows - 防止 Git Gui 突出显示尾随空格

转载 作者:可可西里 更新时间:2023-11-01 11:48:21 25 4
gpt4 key购买 nike

Git Gui 以红色高亮显示行尾的空格;如何关闭此功能?

最佳答案

显然(见评论)Git Gui 在这里使用与普通命令行 git 相同的控制旋钮,即 core.whitespace设置,如 the git config documentation 中所述:

core.whitespace

A comma separated list of common whitespace problems to notice. git diff will use color.diff.whitespace to highlight them, and git apply --whitespace=error will consider them as errors. You can prefix - to disable any of them (e.g. -trailing-space):

  • blank-at-eol treats trailing whitespaces at the end of the line as an error (enabled by default).

  • space-before-tab treats a space character that appears immediately before a tab character in the initial indent part of the line as an error (enabled by default).

  • indent-with-non-tab treats a line that is indented with space characters instead of the equivalent tabs as an error (not enabled by default).

  • tab-in-indent treats a tab character in the initial indent part of the line as an error (not enabled by default).

  • blank-at-eof treats blank lines added at the end of file as an error (enabled by default).

  • trailing-space is a short-hand to cover both blank-at-eol and blank-at-eof.

  • cr-at-eol treats a carriage-return at the end of line as part of the line terminator, i.e. with it, trailing-space does not trigger if the character before such a carriage-return is not a whitespace (not enabled by default).

  • tabwidth=<n> tells how many character positions a tab occupies; this is relevant for indent-with-non-tab and when Git fixes tab-in-indent errors. The default tab width is 8. Allowed values are 1 to 63.

(我不确定 Git Gui 如何允许您修改配置,或者您是否必须从命令行执行此操作。在这种情况下,大概您想要 -trailing-space,或者可能只是 -blank-at-eol。)

关于windows - 防止 Git Gui 突出显示尾随空格,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37876723/

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