How do I go to the next command in Git Bash after using git log?
Asked Answered
R

4

7

When using Git Bash, I type the command:

git log

It shows me all the logs. But now I want to do a second command. So I hold the down arrow to get to the bottom of the logs and it just says (END). How do I get to the next line so I can enter my next command?

Rhoades answered 5/3, 2016 at 22:43 Comment(0)
V
13

By default, Git commands that display a lot of information will show the information through a different program, called terminal pager. These programs basically show you the information in pages, so that you can see everything and not only the very last bit of information at the end.

The most known pagers include more and less.

Git for Windows comes bundled with less and is configured to use that by default. Less gives you the ability to scroll up and down the output (using your arrow keys), so you can browse for as long as you want. In order to exist the program, you need to press the q key on your keyboard. This will put you back into bash.

You can change the paging behavior of Git by configuring the core.pager configuration.

Variation answered 5/3, 2016 at 22:55 Comment(0)
S
2

Git by default will page to less.

Less can be quit by pressing q or by pressing Ctrl + c

Specter answered 5/3, 2016 at 22:47 Comment(0)
V
2

to quit form the git log you need to type q.

If you want to "limit" the log entries :

# display only the first X entries form the log.
# This way you will not have the pager so mo need to quit from the pager
git log -n <number of commits>

If you want to run multiple commands use the &&:

git log -n 10 && git status

--no-pager

--no-pager will disable the pager got the given command.

git --no-pager log  ...
git --no-pager diff ...
Vacancy answered 5/3, 2016 at 22:48 Comment(0)
S
0

You can use B and F for backward/forward navigation in git bash results.

Also using the Space on the keyboard also works for the forward movement.

You can quit the resuls and get back to promp, using Q .

Speaker answered 6/3, 2016 at 5:9 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.