git squash and preserve last commit's timestamp
- by Crend King
Consider I have commits
... -- A -- B -- C
If I use git rebase -i to squash all three commits into one, we could
pick A
squash B
squash C
I see the resulted commit A has its original timestamp. How could make it inherit the timestamp of commit C (the last one)?
What I can think of is git commit --amend --date=<new_time>, but I need to remember the timestamp of commit C before squash or from reflog.
I find the timestamp of the latest timestamp is more reasonable, because it show when do I actually finish the work that are in the commits.
Thanks.