In this case, as snarly suggested, typing q is the intended way to quit git log (as with most other pagers or applications that use pagers). However normally, if you just want to abort a command that is currently executing, you can try ctrl+c (doesn't seem to work for git log, however) or ctrl+z (although in bash, ctrl-z will freeze the currently running foreground process, which can then be thawed as a background process with the bg command).
Benjamin Bannier
Is this you? As a journalist, you can create a free Muck Rack account to customize your profile, list your contact preferences, and upload a portfolio of your best work.
Claim your profile
Get in touch with Benjamin
Contact Benjamin, search articles and posts on X, monitor coverage, and track replies from one place.
Learn more about Muck Rack