View submission History 1. view submission history
Git log does not use any parameters by default,git log
All updates are listed Based on the submission time. The most recent updates are listed at the top.
git log
There 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-diff
Option
$ Git log-U1 -- word-diff
In addition,git log
Many abstract options are available, such--stat
Only 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--since
And--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--author
Option to display the submission of the specified author.--grep
Option 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