Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why do I have to hit 'Q' at the end of 'git log'?

Tags:

git

Consider:

git log -n 20 --pretty=oneline 

I am telling Git that I need to see only the last 20 commits. I hate to hit Q to get rid of END. Is there a way out so that I don't have to hit Q?

like image 787
Nick Vanderbilt Avatar asked Mar 02 '10 16:03

Nick Vanderbilt


People also ask

How do you get to the end of git log?

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.

How do I end git diff?

To exit this you can use: :q for exit; :h for help; Note: if you don't want to read the output in pager you can use an ENV variable GIT_PAGER to cat or you need to set core.

What does git log tell you?

The git log command shows a list of all the commits made to a repository. You can see the hash of each Git commit, the message associated with each commit, and more metadata. This command is useful for displaying the history of a repository.


1 Answers

Git is automatically paging the output for you, since logs tend to easily overflow a single terminal window size (you're in one of the rare exceptions - a oneline format and a small commit limit). If you don't want this, use:

git --no-pager log -n 20 --pretty=oneline 

Note that this does mean you'll get some ugly wrapping, because the pager was previously turning off wrapping for you (since you could use the cursor keys to scroll left-right).

like image 159
Cascabel Avatar answered Sep 19 '22 06:09

Cascabel