5

How to exit from the long output of a terminal command or a git command like git log or git branch -a?

How to avoid that I have to press enter untill the output of the command is complete?

Remover
  • 1,616
  • 1
  • 17
  • 27

2 Answers2

16

git log uses more or less for paging the output.

You can press q to stop more/less and drop the remaining output.

mrb
  • 3,281
  • 1
  • 20
  • 31
  • more or less but less is more – ouah Jul 11 '12 at 19:53
  • Fun fact: You can pipe `git log` and `git show` to `less` in such a way as to start at the first instance of `` and move through output with `n`: `git log -1000 | less +/`. Same works for `git show`: `git show | less +/`. Just kind of fun since we're talking about it. – Christopher Jul 11 '12 at 20:23
  • If the output is bigger than the pipe buffer, "q" will break the pipe and usually ends the first process which encounter output error. – pizza Jul 11 '12 at 21:14
-3

Ctrl-C is the entire answer, though it's too short to go in this field.

Dan Ray
  • 21,623
  • 6
  • 63
  • 87