From 48074f4ba8c9bb3f39191d283250533e8043be4c Mon Sep 17 00:00:00 2001 From: Asocia Date: Mon, 10 May 2021 08:42:33 +0300 Subject: [PATCH] TIL: Rebasing without overwriting commit dates --- git/rebasing-without-overwriting-commit-dates.md | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 git/rebasing-without-overwriting-commit-dates.md diff --git a/git/rebasing-without-overwriting-commit-dates.md b/git/rebasing-without-overwriting-commit-dates.md new file mode 100644 index 0000000..06d7f7f --- /dev/null +++ b/git/rebasing-without-overwriting-commit-dates.md @@ -0,0 +1,10 @@ +When you do + +``` +git rebase -i commitish +``` +and edit some commits, you will recreate the history hence all the commits coming after edited one will have the same date and time. If you don't want this behaviour here is the trick: +``` +git rebase --committer-date-is-author-date -i commitish +``` +Note that you need git version 23.19 or greater to do this in interactive mode.