是否有要传递给的命令行开关git diff和默认使用less寻呼机的其他命令?我知道这些方法存在:
git diff
less
git diff | cat
git config --global core.pager cat
cat
export GIT_PAGER=cat
但我更喜欢命令行开关。
--no-pager到 Git 会告诉它不要使用寻呼机。如果输出适合单个屏幕,则将选项传递-F给将告诉它不分页。less
--no-pager
-F
用法:
git --no-pager diff
评论中的其他选项包括:
# Set an evaporating environment variable to use 'cat' for your pager GIT_PAGER=cat git diff # Tells 'less' not to paginate if less than a page export LESS="-F -X $LESS" # ...then Git as usual git diff