Skip to content

Instantly share code, notes, and snippets.

@shirakaba
Created July 12, 2024 03:43
Show Gist options
  • Save shirakaba/1938a615bf550f8cd8eb94e398643a76 to your computer and use it in GitHub Desktop.
Save shirakaba/1938a615bf550f8cd8eb94e398643a76 to your computer and use it in GitHub Desktop.
Changing timestamp on commit
# Interactively rebase the current branch onto `main`
git rebase -i main

Modify the commit dates of first commit and second commit but leave third commit unchanged.

pick c40f82d first commit
exec git commit --amend --no-edit --date "Wed Jul 10 08:30:00 2024 +0900"
pick 09604ec second commit
exec git commit --amend --no-edit --date "Wed Jul 10 08:45:00 2024 +0900"
pick d624b4e third commit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment