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?
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.
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.
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.
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).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With