How to filter Git log by date
Filtering Git log by date enables tracking project progress, analyzing development patterns, and generating reports for specific time periods.
As the creator of CoreUI with 25 years of development experience, I’ve used date-based filtering extensively for sprint reviews and project analysis.
The most effective approach uses --since and --until flags with flexible date formats including relative dates and specific timestamps.
This method provides precise historical analysis for project management and code auditing.
Use git log --since and --until to filter commits within specific date ranges.
git log --since="2 weeks ago"
git log --since="2023-01-01" --until="2023-12-31"
git log --after="yesterday" --before="today"
git log --since="3 months ago" --author="John" --oneline
The --since (or --after) and --until (or --before) flags accept various date formats including relative dates like “2 weeks ago”, “yesterday”, and absolute dates like “2023-01-01”. You can combine date filtering with other options like --author for author-specific time-based analysis. Git supports natural language date expressions for intuitive filtering.
Best Practice Note:
This is the same date-based commit analysis we use in CoreUI development for sprint retrospectives and release planning.
Use ISO date format (YYYY-MM-DD) for consistent results across different locales and combine with --stat for detailed change summaries within date ranges.



