Git help Document Reading Notes-Chapter 2-Section 2

Source: Internet
Author: User
View submission History 1. view submission history

Git log does not use any parameters by default,git logAll updates are listed Based on the submission time. The most recent updates are listed at the top.

git logThere are many options to help you search for submissions you are interested in.

1. The-P option is displayed to show the content difference of each submission.

2.-2 display the last two updates

In addition to displaying basic information, this option also includes the change of each commit. This parameter is useful when you perform code review or quickly browse changes to the commit submitted by a partner.

In some cases, word-level comparison is easier to observe than Row-level comparison. Git provides--word-diffOption

$ Git log-U1 -- word-diff

In addition,git logMany abstract options are available, such--statOnly show brief statistics on the number of rows to be added and changed

-- Pretty = oneline

-- Pretty = format: "% H-% an, % AR: % s"

Format and display output information

 

2. Limit the output Length

There are also time-based options, such--sinceAnd--until. The following command lists all submissions in the last two weeks:

$ git log --since=2.weeks

You can also provide several search criteria to list the submissions that match the criteria. Use--authorOption to display the submission of the specified author.--grepOption to search for keywords in the submission instructions. (Note: If you want to obtain a submission that meets both the search criteria, you must use--all-match. Otherwise, any submission meeting any condition will be matched)

3. view submission history using graphical tools

Gitk

 

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.