TIL - Git log between dates
It’s not uncommon for devs to need to recall what was committed in a given period and/or by a particular individual, this information might be necessary to help troubleshoot a bug that is suspected to have been introduced in a period, or share the info during stand-ups, quarterly reviews, or when drafting promotion cases. Usually, most resort to browsing Jira’s or GitHub’s UI, and that works fine… unless you/they work in a very fast-paced environment, using monorepos to make matters worse.
A simpler way to find the info could be to ask git for the log of commits made by a particular author during a given period, as in the example below.
git log --since "April 1 2024" --until "June 30 2024" --author='Phagula' --oneline
Which could be further simplified by providing the dates in a natural language, like
git log --since "2 weeks ago"
I’d be remiss to point out that a git log may not show the full picture, as commits are not the only way people contribute to software projects, but if you’re for the most part a programmer, it is still quite a handy tip to note.