问题:
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
来源:oschina
链接:https://my.oschina.net/stackoom/blog/4411057