Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Git log shows wrong commit date

Tags:

git

For some reason all my recent git commits are being comitted with the wrong date.

I made two commits yesterday and one commit today and they all shows up as being commited 16 days ago. More specifically Fri Oct 31 15:32:21 2014 +0100.

Running date on my computer yields Sun 16 Nov 2014 12:55:08 CET, so my computers time is correct.

When pushing the repository to GitHub the problem persists.

Update #1:

The repository in question can be found here on Github

The file listing shows the commit being made, when this is written, 25 minutes ago. Which is correct.

The commit log has the commits in the correct date but showing authored 16 days ago

Update #2:

OS:

Darwin Juno.local 13.4.0 Darwin Kernel Version 13.4.0: Sun Aug 17 19:50:11 PDT 2014; root:xnu-2422.115.4~1/RELEASE_X86_64 x86_64.

GIT Version:

git version 1.8.5.2 (Apple Git-48)

GIT environment variables:

GIT_DIR=.git
GIT_AUTHOR_DATE=@1414765941 +0100
GIT_INDEX_FILE=.git/index
GIT_AUTHOR_NAME=codeaken
GIT_PREFIX=
GIT_AUTHOR_EMAIL=<removed>
like image 698
codeaken Avatar asked Nov 16 '14 11:11

codeaken


1 Answers

If you have an environment variable (like GIT_AUTHOR_DATE) set when you do your comit, that date will be used (instead of the current one)

Try unsetting GIT_AUTHOR_DATE.

GIT_AUTHOR_DATE is usually used within git command (like git filter-branch) to set commits in the past. See "How do I make a Git commit in the past?".

Regarding GitHub:

  • The file listing in GitHub is based on the commit date, not the author date.
  • The commit log displays the author date, not the commit date.
like image 71
VonC Avatar answered Oct 04 '22 08:10

VonC