9

I have just started to use Git on Anaconda (Windows 10). When I do some commits and then I ask the git log, it shows me all the history of my commits but I do not know how to get out from it.

At the beginning I did not have this problem since after typing git log it showed me the history and then I was automatically able to type new commands on my terminal.

Now instead when I type git log, it shows me the history and I do not know how to type new commands (besides the method to close and re-open). How can I fix this ?

I attach the image of what I see.

enter image description here

Thank you in advance.

0

1 Answer 1

13

This looks like a pager (less/more?) set in Git itself. Many pagers quit when you press q.

Another preeemptive tip is to use the -n flag to limit the output of git log. Like enter git log -n 3 to only see the last 3 commits.

As for the reason you are now in this situation is simply you are adding more and more commits as your project goes on. So initially it was only one or two commits. But then after you do more and more work, the commit count increases past the amount of commits that can be shown on one screen.

Additionally you may find these links useful:

2
  • 3
    It works by pressing q !!!! Thank you so much. And yes it is a pager (it is explained here). Commented Mar 13, 2022 at 12:52
  • 2
    It seems pressing q does not work if you have already tried all possible keyboard combinations. I hammered on Esc, Ctrl+C, Ctrl+Z and Ctrl+Q for a couple of minutes and then googled this. Too late. Closing the console window helped me calm down a bit though.
    – l33t
    Commented Nov 16, 2022 at 10:02

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .