How do I prevent git diff from using a pager ?

How do I prevent git diff from using a pager ?

Asked on January 4, 2019 in Git.
Add Comment


  • 3 Answer(s)

    –no-pager to git, Passing the option -F have no output page file in the screen .

    Usage:

    git --no-pager diff
    

    Or,

    # set an evaporating environment variable to use cat for your pager
    GIT_PAGER=cat git diff
    # tell less not to paginate if less than a page
    export LESS="-F -X $LESS"
    # ...then git as usual
    git diff
    

    Answered on January 4, 2019.
    Add Comment

    As a previous answer mentioned, passing the –F option to quit all the content in one screen,  and then screen is reset the  seeing content, the –X option use the following to enable conditional paging based on the amount of content:

    git config --global --replace-all core.pager "less -F -X"
    
    

    Answered on January 4, 2019.
    Add Comment

    Try this below code:

    git config --global core.pager cat
    
    

    Pager for all commands for all repositories:

    Git subcommands by using pager.<cmd> setting alternative for core.pager and they change your settings for omit –global.

    Git-config and search for pager.<cmd> for details.

    Answered on January 4, 2019.
    Add Comment


  • Your Answer

    By posting your answer, you agree to the privacy policy and terms of service.