Search code examples
gitdifftool

How to setup difftool to use pager


If I use a difftool that has simple shell output how to use pager that is set up in core.pager .gitconfig section?


Solution

  • git help config says:

    pager.<cmd>
        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.<cmd>. 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.
    

    So all you need is to add a [pager] section in .gitconfig and to place difftool = true there.