HugoDF
4 months ago

Change the date of a git commit

Set the date of the last commit to the current date: GIT_COMMITTER_DATE="$(date)" git commit --amend --no-edit --date "$(date)"

Set the date of the last commit to an arbitrary date: GIT_COMMITTER_DATE="Mon 20 Aug 2018 20:19:19 BST" git commit --amend --no-edit --date "Mon 20 Aug 2018 20:19:19 BST"

Set the date of an arbitrary commit to an arbitrary or current date: Rebase to before said commit and stop for amendment + change the date as above. See Change the date of a git commit for full walkthrough of this case.

Do you have any comment on this tricks? then let the author know about that. comment here