How to exit git log or git diff [duplicate] How to exit git log or git diff [duplicate] git git

How to exit git log or git diff [duplicate]


You're in the less program, which makes the output of git log scrollable.

Type q to exit this screen. Type h to get help.

If you don't want to read the output in a pager and want it to be just printed to the terminal define the environment variable GIT_PAGER to cat or set core.pager to cat (execute git config --global core.pager cat).


Actually, there are three ways to do it, precisely.

Type any of the following 3 commands.

  1. :q
  2. :zor
  3. Ctrl + z

P.S.: Sometimes, for someone, one of these options doesn't seem to work and for others it works.


You can press q to exit.

git hist is using a pager tool so you can scroll up and down the results before returning to the console.