Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to exit git log or git diff [duplicate]

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?

like image 687
Wern Ancheta Avatar asked Feb 28 '12 14:02

Wern Ancheta


People also ask

How do you exit a git tag?

Just press 'q' button to exit from interactive mode.

How do I escape a git branch?

You typically can use the arrow keys to scroll up or down, and can exit by pressing q.

How do I exit git master?

by going to the parent folder with cd .. and removing the . git folder in all child folders with the -r option you are telling people that it is ok to destroy all local copies of their repositories on their machines, potentially.


2 Answers

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

like image 56
4 revs, 2 users 71% Avatar answered Sep 28 '22 22:09

4 revs, 2 users 71%


Actually, there are three ways to do it, precisely.

Type any of the following 3 commands.

  1. :q
  2. :z or
  3. Ctrl + z

P.S.: Sometimes, for someone, one of these options doesn't seem to work and for others it works.

like image 31
shrexchauhan Avatar answered Sep 28 '22 21:09

shrexchauhan