如何打开寻呼机以输出git status? [英] How can I turn on a pager for the output of git status?

查看:84
本文介绍了如何打开寻呼机以输出git status?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我希望在类似less的环境中返回git status的输出.这已经适用于git diff,但不适用于git status.我已经尝试将以下内容添加到~/.gitconfig,但是没有用:

I want the output of git status to be returned in a less-like environment. This already works for git diff, but not git status. I already tried adding the following to ~/.gitconfig, but it didn't work:

[core]
  pager = less

我想念什么?谢谢.

推荐答案

您可以使用

pager.<cmd>

如果值为boolean,则在写入tty时打开或关闭特定Git子命令输出的分页.否则,请使用由pager值指定的寻呼机为子命令打开分页.如果在命令行上指定了--paginate或--no-pager,则该选项优先于此选项.要禁用所有命令的分页,请将core.pager或GIT_PAGER设置为cat.

If the value is boolean, turns on or off pagination of the output of a particular Git subcommand when writing to a tty. Otherwise, turns on pagination for the subcommand using the pager specified by the value of pager.. If --paginate or --no-pager is specified on the command line, it takes precedence over this option. To disable pagination for all commands, set core.pager or GIT_PAGER to cat.

运行以下命令:

git config --global pager.status true

或手动将以下内容添加到〜/.gitconfig的末尾:

or manually add the following to the end of your ~/.gitconfig:

[pager]
  status = true

这篇关于如何打开寻呼机以输出git status?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆