Essential Git for Scientists
  • Introduction
  • Basic Concepts
    • Version Control
    • Git
    • Repo
    • Commits
    • Branches
    • Remotes
    • GitHub
    • De-centralisation
    • Summary
  • Basic Operations
    • Install Git
    • Create a Repo
    • Make a Commit
    • Inspect a Previous Commit
    • Revert a Change
    • Make a Branch
    • Extend a Branch
    • Fast-forward merge
    • Resolve conflicts
  • Intermediate Concepts
    • Commits
    • Three Trees
    • Rebase
    • Fetch
    • Pull
    • Push
  • Advanced Concepts
    • Reset
    • Interactive rebase
    • Formatted patches
    • Blame
    • Stash
    • Log filter
  • Cookbook
    • Undo
    • Branches
    • Diff
    • Stash
    • Merge
    • Hooks
    • Squashing
    • Rebase
    • Interactive Rebase
    • LFS
    • Submodules
    • Remote
    • Force push
    • Identify merged branches
    • Formated patches
    • Apply patches
    • Interactive rebase
    • Squash commits
    • Pull rebase
    • Log
    • Blame
    • Biset
    • Reset
  • Exercise
    • Exercise 1
    • Exercise 2
Powered by GitBook
On this page
  1. Advanced Concepts

Log filter

How to filter results in the commit history?

There are various arguments you can add to git log. Here are some commonly used attributes you can filter on

  • Author

    • git log --author="Jason"

  • Date

    • git log --since="2023-07-22"

    • git log --before="2023-06-01"

    • git log --after="1998-05-30"

  • Messege

    • git log --grep="bug"

  • File

    • git log -- analyse.py

You can combine these filters, e.g.

git log --author="David Johns" --before="2023-07-20" --after="2020-01-01" --grep="registration"
PreviousStashNextUndo

Last updated 1 year ago