1. Find a log that changes all of a file
git log--pretty=----pretty=format:"%h %an,%cd:%s" Somefile.java
2. Formatted output, git log--pretty=format: ""
option Description %H Commit object (commit) full hash string %H Commit object short hash string %T Tree Object (tree) full hash string %T tree object short hash string%p Parent object (parent) full hash string %p Parent object short hash string% an Author (author) name %AE author's e-mail address %ad Author revision date (can use-date= option custom format)% ar Author revision date, as of how long ago display %cn Submitter (committer) name %CE Submitter e-mail address %CD Submission Date %CR Submission Date, as of how long ago display %s submission Description
git log--pretty=format:"%h %an,%cd:%s"
3. Specify date, keyword, author
--since,-- after only the commit after the specified time is displayed. git log--since=2.days--until,--before only shows the commit before the specified time . git log--until=10.days-author only shows the commits that are related to the specified author . git log--author=beginman--committer shows only the commits associated with the specified submitter . git log--committer=jack
--grep displays only the commits for the specified keyword . git log--grep=init
Note the author's relationship with the submitter: the author is the person who modified the program, and the submitter is the code author.
As specified 2 days ago, the author "Beginman" commits the first 2 entries containing the keyword ' init ': $ git log--since=2.days--author=beginman--grep=init-2
Note: The parameters following the above options can be enclosed with single double quotes, such as--author= "Beginman"
4. Display the modified file
--name- only displays the list of modified files after the information is submitted
--name-status Show List of new, modified, deleted files
git log--name---name-only----name---name-status--oneline
5. Display Log Statistics
--stat Displays the file modification statistics for each update, and also shows the updated file name and the number of modifications. --shortstat only displays--the last number of rows in thestat modifies the added statistics. The updated file name is not displayed.
Git log--stat--stat ------shortstat--oneline
6. Show single-day log information
Show ID Show ID]--name-showID]--name-only-showID]--name-show ID]--statshowID]--shortstat
git log--log