I started a new repo and pushed something to it and my gitlog states that it was created 3 months ago. When I check my github contributions calendar it is listed as being created 3 months ago. All new files I create and commit now are being marked as being committed 3 months ago. How do I reset my git commit date to the current date?
Asked
Active
Viewed 70 times
1 Answers
1
You can use a script in order to change the committer and author date of any git commit:
See "How to push a file to past time?"
git rcd @ "1 hour ago"
Check also if you haven't defined, in your current environment variables, GIT_COMMITTER_DATE
or GIT_AUTHOR_DATE
: that would explain why creating a new commit doesn't use the current date.
-
Thanks. Sorry for my naivity but how do I check/set enviroment variables? That actually may be the issue. Thanks again VonC – chopper draw lion4 Dec 17 '14 at 07:49
-
1@chopperdrawlion4 what OS are you using? Try typing `env` or `set` – VonC Dec 17 '14 at 07:49
-
Cool got it! I just had to unset those environment variables. Works like a charm, thanks! – chopper draw lion4 Dec 17 '14 at 07:58
-
@chopperdrawlion4 good job! Check any environment variable starting with GIT: they can influence how git works. – VonC Dec 17 '14 at 08:00