[Practical Git] Navigate git command pager output with Unix less commands

Source: Internet
Author: User

When using a git command that can has a large amount of output (like git log , git diff or git blame ), Git opens the command outpu T in our terminal "pager"; On most modern unix-based systems, the default pager would be ' less '. Learning a few less commands would help us deal with this git command output that opens in the pager. In this lesson, we show some of the very useful of the less commands: (quit), (off), (up q j k ), Ctrl f (Forwar D), Ctrl b (Backward), ( /{search} search), and n / N (next/previous search result).

This lesson is covers some of the most critical less commands; There is more commands available. A good chunk of the commands (and "motions") of the Unix pagers is also used by VI (or VIM) and other UNIX programs.

One useful tip when we doing ' git log ' are search term:

git log  //  show the git logs'/'/ '  seach for bugs in our logs

And also if you want to nav between the search results, you can do:

' N '  'n'+ N

[Practical Git] Navigate git command pager output with Unix less commands

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.