What are common git log options?

QuestionsQuestions8 SkillsProYour First Git LabNov, 03 2025
0247

Here are some common git log options:

  1. --stat: Shows the files that were modified in each commit along with the number of lines added or removed.

    git log --stat
    
  2. -p: Displays the actual patch (the lines added and removed) for each commit.

    git log -p
    
  3. --pretty: Allows you to customize the output format. For example:

    git log --pretty=format:"%h - %an, %ar : %s"
    
  4. --oneline: Shows a simplified output with one commit per line, displaying the abbreviated commit hash and the commit message.

    git log --oneline
    
  5. --graph: Visualizes the commit history as a graph, showing branches and merges.

    git log --graph
    
  6. --author: Filters commits by a specific author.

    git log --author="Author Name"
    
  7. --since and --until: Limits the log to commits made within a specific date range.

    git log --since="2023-01-01" --until="2023-12-31"
    

These options can be combined to tailor the output to your needs.

0 Comments

no data
Be the first to share your comment!