Git attempts to display command output using a pager program (typically 'less') but cannot find or execute it. This causes Git commands like log, diff, and show to either fail or dump raw output directly to the terminal.
Git uses a pager program to display long command output in a scrollable, readable format. By default, Git tries to use 'less' as its pager for commands like git log, git diff, and git show. When Git cannot find the pager executable in your system PATH, or when the configured pager program doesn't exist, you'll see a pager failure warning. This error typically occurs in minimal environments (Docker containers, CI/CD pipelines, Windows Subsystem for Linux) where 'less' or the configured pager isn't installed, or when Git's pager configuration points to an invalid program or path. Before Git 2.46 (Q3 2024), some code paths would fall back to dumping output directly to stdout, but newer versions fail immediately when the pager cannot be spawned. The pager is controlled by three mechanisms in order of precedence: the GIT_PAGER environment variable, the core.pager Git configuration setting, and finally the PAGER environment variable. If all are unset, Git defaults to 'less' with specific flags (FRSX).
First, identify what pager Git is configured to use:
git config --get core.pager
echo $GIT_PAGER
echo $PAGERIf core.pager returns a value, that's what Git is trying to execute. If empty, check the environment variables. Git will default to 'less' if nothing is configured.
Check if the pager program is installed and accessible:
# Check if less is installed
which less
less --version
# Or check for more
which more
# On Windows
where less
where moreIf the command is not found, you need to either install it or configure Git to use a different pager.
Install 'less' or another pager on your system:
# Ubuntu/Debian
sudo apt-get update && sudo apt-get install less
# Alpine Linux (common in Docker)
apk add less
# macOS (usually pre-installed, but via Homebrew if needed)
brew install less
# Windows with Chocolatey
choco install lessFor Docker containers, add to your Dockerfile:
RUN apt-get update && apt-get install -y lessIf you can't install 'less', configure Git to use an alternative pager that exists on your system:
# Use 'more' instead (available on most systems)
git config --global core.pager more
# On Windows, use the full path to more.com
git config --global core.pager '"C:\Windows\System32\more.com"'
# On MSYS/Git Bash, use full path to less
git config --add --global core.pager /usr/bin/less
# Use cat (disables paging, shows all output at once)
git config --global core.pager catVerify the change:
git config --get core.pagerIf you don't need paging functionality, you can disable it completely:
# Set pager to empty string (disables paging globally)
git config --global core.pager ''
# Or unset the pager configuration
git config --global --unset core.pager
# Remove all pager settings if multiple exist
git config --global --unset-all core.pagerYou can also disable paging per-command:
# Temporary: use --no-pager flag
git --no-pager log
git --no-pager diff
# Or set environment variable for single command
GIT_PAGER=cat git logIf you have conflicting environment variables, clear or correct them:
# Check current environment variables
env | grep PAGER
# Unset GIT_PAGER if it's causing issues
unset GIT_PAGER
# Or set it to a working pager
export GIT_PAGER=less
# On Ubuntu/systems where PAGER is unset
export PAGER=moreAdd to your shell profile (~/.bashrc, ~/.zshrc) to make permanent:
export PAGER=lessVerify that Git commands now work with the pager:
# Test with a command that uses the pager
git log
git diff HEAD~1
# Should open in pager without errors
# Press 'q' to quit the pagerIf you disabled paging, verify output appears directly in terminal without errors.
Pager Precedence and Customization
Git determines which pager to use in this order: GIT_PAGER environment variable → core.pager config → PAGER environment variable → DEFAULT_PAGER (less). You can configure different pagers for different Git commands using per-subcommand settings like git config --global pager.diff 'less -FX' while keeping other commands unpaged.
Smart Paging with less -FX
For less version 530+, configure core.pager to less -F (or less -FX for older versions) to automatically exit if output fits on one screen, eliminating unnecessary paging for short output. Git sets the LESS environment variable to 'FRSX' by default if unset (F=quit if one screen, R=raw control chars, S=chop long lines, X=no init).
Docker and CI/CD Considerations
In automated environments where interactive paging isn't needed, disable the pager globally in your Dockerfile or CI configuration: RUN git config --global core.pager cat or use the --no-pager flag in all Git commands. This prevents failures in minimal container images while keeping your local development environment intact.
Windows Path Issues
On Windows, pager paths must be properly quoted if they contain spaces. Use double quotes around the path: git config --global core.pager '"C:\Program Files\Git\usr\bin\less.exe"'. For PowerShell, the quoting requirements may differ from Command Prompt.
Permission and Security Context
Since Git 2.46, pager spawn failures always cause immediate command failure rather than falling back to stdout dumping. This prevents accidental exposure of sensitive information in logs when paging fails. If you encounter permission-denied errors, verify the pager executable has execute permissions and isn't blocked by security policies like SELinux or AppArmor.
warning: BOM detected in file, this may cause issues
UTF-8 Byte Order Mark (BOM) detected in file
fatal: Server does not support --shallow-exclude
Server does not support --shallow-exclude
warning: filtering out blobs larger than limit
Git partial clone filtering large blobs warning
fatal: Server does not support --shallow-since
Server does not support --shallow-since in Git
kex_exchange_identification: Connection closed by remote host
Connection closed by remote host when connecting to Git server