Skip to content

Instantly share code, notes, and snippets.

@niqdev
Created October 10, 2022 17:32
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 niqdev/a0d59d1cbcaf1578b3ce14829ae282b6 to your computer and use it in GitHub Desktop.
Save niqdev/a0d59d1cbcaf1578b3ce14829ae282b6 to your computer and use it in GitHub Desktop.
How to tag an older commit in git preserving the original date
git checkout <COMMIT_SHA>
GIT_COMMITTER_DATE="$(git show --format=%aD | head -1)" git tag vX.Y.Z
git push origin --tags
git checkout main
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment