How do i display a custom view of the git commit log?



  • Man page for git-log.

    If the standard git log options are not enough you can customise the output by using a combination of these format options with the git log --pretty=format command.

    %H - Commit hash
    
    %h - Abbreviated commit hash
    
    %T - Tree hash
    
    %t - Abbreviated tree hash
    
    %P - Parent hashes
    
    %p - Abbreviated parent hashes
    
    %an - Author name
    
    %ae - Author email
    
    %ad - Author date (format respects the --date=option)
    
    %ar - Author date, relative
    
    %cn - Committer name
    
    %ce - Committer email
    
    %cd - Committer date
    
    %cr - Committer date, relative
    
    %s - Subject
    
    $ git log --pretty=format:"%an made a commit: %h - %ar - %s"
    

    Output:

    Sector made a commit: fe33353 - 22 hours ago - Made a small change
    Sector made a commit: 2e3853f - 11 months ago - Up
    Sector made a commit: 66d5145 - 11 months ago - Initial Commit
    

Log in to reply
 

© Lightnetics 2024