How to exit git log or git diff

Wern Ancheta picture Wern Ancheta · Feb 28, 2012 · Viewed 375.1k times · Source

I'm trying to learn Git with the help of Git Immersion.
There's one thing that frustrates me whenever I use git log or git diff:

Git log shows (END) marker

I can't figure out what to do next when I encounter this (END) word.

I can't type any commands, and I end up closing the current Bash window and open another. How do I type in the next command that I want to use?

Answer

Fred Foo picture Fred Foo · Feb 28, 2012

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).