-2

git log --since=1.day command displaying commits from June 27th despite today being July 3rd.

I'm encountering an issue with the git log --since=1.day command in Git. According to the Git documentation, --since= should limit the log to commits made after the specified date. However, when I run git log --since=1.day, it's returning commits from June 27th, despite today being July 3rd.

As a beginner, I'm unsure how to modify the command to show only commits made in the last 24 hours based on the commit date.

I expected that it would show me the commits made within the last 24 hours only.

1
  • Welcome to the community. I have no idea why your question is being downvoted. Please don't be discouraged. As far as I can tell, you asked a well formed question. To the community I would add - if you find a question unhelpful, don't just downvote, explain why you deem the question unworthy.
    – Lockszmith
    Commented Jul 5 at 20:06

2 Answers 2

2

My guess is that you are looking at the author date which is June 27th, but --since is looking at the commit date which is later.

Try git log --format=fuller to see both author date and commit date for your commit.

-1

I recently learned that there is a difference between the author date and the commit date in Git. I suspect that the command might be showing the author date instead of the commit date, which has led to my confusion. So here what I learnt now:

Author Date: This is the date when the changes were originally made. It represents when the author created the changes and it returns the timestamp when the author made the initial change.

Commit date: This date reflects when the changes were last applied or altered in any significant way, such as during a rebase or amend. It represents when the commit was created or modified.

When you run git log --since=1.day, Git shows you the commits that were made within the last 24 hours, based on the commit date. However, the git log command also displays the author date for each commit.

So, even though the filtering is done based on the commit date, the output still shows the author date for each commit.

Screenshot showing the issue with git log --since=1.day where commits from June 27th are included. The confusion was due to differences between author date and commit date.

Not the answer you're looking for? Browse other questions tagged or ask your own question.