git log View the commit history of the current branch
After submitting a number of updates, to review the commit history, you can use the git log
command to view
By default, git log
all updates are listed by time of submission, and most recent updates are on top. See, each update has a SHA-1 checksum, the author's name and e-mail address, the time of submission, and the final indentation of a paragraph showing the submission instructions.
git log
There are many options to help you search for interested submissions, so let's introduce some of the most common ones.
We use the -p
option to expand the display of content differences for each commit, with -2
only the last two updates displayed :
$ git log-p-2
In addition, there are a number of summary options that --stat
can be used, for example, only a brief display of the number of row count statistics, each submission lists the modified file, and the number of rows added and removed in it, and the last list of all the increment and decrement line count subtotals.
$ git log--stat
--author displays only the commits associated with the specified author.
$ git log--author=haiwang
Find the version submitted by Haiwang;
git log to view the commit history of the current branch