Skip to content

Instantly share code, notes, and snippets.

@kargaranamir
Created September 26, 2023 02:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kargaranamir/bb340bd47dddceb64728701c8ccce75d to your computer and use it in GitHub Desktop.
Save kargaranamir/bb340bd47dddceb64728701c8ccce75d to your computer and use it in GitHub Desktop.
How to change a recent commit date.
  1. change GIT_COMMITTER_DATE variable:
export GIT_COMMITTER_DATE="Sat Sep 20 08:00:00 2023 +0000"
  1. then commit your changes! I use GitHub UI, it's much easier to handle some of the tasks. But don't push!
  2. git commit --amend --no-edit --date="$GIT_COMMITTER_DATE"

finished.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment