如何防止'git diff'使用寻呼机?

孤人 提交于 2020-08-13 01:19:30

问题:

Is there a command line switch to pass to git diff and other commands that use the less pager by default? 是否有命令行开关可以传递给git diff和默认情况下使用less分页器的其他命令?

I know I can pipe it to cat, but that removes all the syntax highlighting. 我知道我可以将其通过管道传递给cat,但是这样可以删除所有语法突出显示。

I know I can set the pager in the global .gitconfig to cat by GITPAGER=cat (or something like that); 我知道我可以通过GITPAGER=cat (或类似的东西)将全局.gitconfig中的寻呼机设置为cat。 but I want to have pager sometimes (depending on the size of the diff). 但我有时想传呼(取决于diff的大小)。

But, I would prefer a command line switch if there is one; 但是,如果有的话,我希望使用命令行开关。 and I am not able to find one, going through the man pages. 我找不到手册页中的内容。


解决方案:

参考一: https://stackoom.com/question/9A8C/如何防止-git-diff-使用寻呼机
参考二: https://oldbug.net/q/9A8C/How-do-I-prevent-git-diff-from-using-a-pager
标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!