Why do long results from Git commands kill my PowerShell prompt?
Several of the git commands use a pager to allow you to view one screen full of information at a time. The one that come with git is usually less
(more info). You can visit the link for common commands, but as you've found the most important is q
to quit to get back to the command prompt. The next most useful one I've found is space to move to the next screen full.
You can change the pager used if you like in the git config file's core.pager
field.
Just to add to the existing answers, the normal "windows" pager is more.com
, which is usually referenced from cmd
as simply more
, but hidden by the function more
with similar functionality in PowerShell
. If you set
git config --global core.pager more.com
your problems should go away (although at the cost of features that exist in less but not more).
This is an old question, but I thought I would mention that git also provides a --no-pager option for you to leverage as well.
git --no-pager log
Hope that helps someone.