Created
October 10, 2022 17:32
-
-
Save niqdev/a0d59d1cbcaf1578b3ce14829ae282b6 to your computer and use it in GitHub Desktop.
How to tag an older commit in git preserving the original date
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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