Skip to content

Instantly share code, notes, and snippets.

@shirakaba
Created July 12, 2024 03:43
Show Gist options
  • Select an option

  • Save shirakaba/1938a615bf550f8cd8eb94e398643a76 to your computer and use it in GitHub Desktop.

Select an option

Save shirakaba/1938a615bf550f8cd8eb94e398643a76 to your computer and use it in GitHub Desktop.

Revisions

  1. shirakaba created this gist Jul 12, 2024.
    14 changes: 14 additions & 0 deletions Changing timestamp on commit.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,14 @@
    ```sh
    # 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
    ```