-1

I am working on a project and for multiple reasons, I need a commit of code that I have just completed to have the date of two hours ago. Is there a way to do this? I am not very familiar with git. Usually, I would type in "git commit -m 'message'". Any help would be appreciated.

masonc15
  • 1,043
  • 2
  • 12
  • 19
  • 1
    Are you aware that there are two dates associated with a commit (the author date and the commit date) and what the difference is between them? Do you know which of these dates you're interested in changing? – user229044 Sep 30 '15 at 19:07

1 Answers1

1

If what you want to set is the author date, use --date as suggested above. If you want to set the committer date then:

GIT_COMMITTER_DATE="<some date>" git commit -m 'message'
Wolf
  • 4,254
  • 1
  • 21
  • 30