Git for paging Windows

Whenever I execute the git log command, it cannot be interrupted. If I do Ctrl + C, it exits the swap environment, but if I start typing something, it will run the git log command again.

+3
source share
2 answers

as already mentioned, git log -X restrict your output to the last commit X.

Git log and other git commands invoke the less command. This is a pager. To get help with a pager, type? or h when viewing the output. You will now see help for the less command. Get away less, just type q .

If you do not want the log to use the pager utility, you can tell git not to use it with:

 git --no-pager log 

Git There are many options in the magazine. To get an overview of what happened, I use

 git log --all --graph --online --decorate 

The scenery can be configured to be enabled by default through the configuration, so you do not need to release it.

If you think you have a lot to write on the command line, you are right! Bash has a quick fix for this: CTRL-R . Click this and start typing "graph". You should get the last time you typed this long command. This is one of the reasons I'm not worried about git aliases; It’s easy to find a history of commands that is saved from session to session.

In addition, you can limit the output of git log specific author or a specific date range, etc.

Enjoy learning and stick to the command line. This is what git should have been used for. You'll also learn a lot of great Bash methods that will help you get a ton when you continue with git.

+3
source

You can limit the number of commits to be shown:

  git log -n 10 

To limit only the last 10 commits.

You can also use the GUI for git, for example gitk or tig or git-cola . Check out other gui customers here .

+1
source

All Articles