"Rebase and merge" should keep the original commits' timestamps #110560
Replies: 3 comments 1 reply
|
I ran into this same issue. I cannot understand why they made this customization to do what we don't want. It's noted here in their docs.
I have a use case where I have This is what I have to deal with: I had to write a custom github action to forcibly rebase backwards so that staging gets this nonsense re-written history. You can see that I have a commit hash then it gets re-written on Githubs rebase merge and I have to update staging. I shouldn't have to update staging. It had the commit before. |
|
https://gist.github.com/alixodendhal/b630d9ff7ef7eaa7ed06e7b9fc51d7cc You need to set an access token secret in the Repo. Since you are forcibly re-writing staging you will need to force push. Which is less than ideal. I allowed only this specific access token to re-write the commit history. |
|
|

Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Select Topic Area
Product Feedback
Body
When merging a PR by "rebase and merge", the commit date and time of every commit in the PR are overridden to the PR merge time.
This was always unexpected to me, as this is not how the actual
git rebasecommand works. In my opinion, every commit should preserve its original commit date and time.This has no relation to the actual order of the commits. By the way Git works, the commits should still all be moved to the top of the branch, but with no changed to its timestamp.
An additional thought is that maybe even "squash and merge" should keep the last commit date and time as the squashed commit timestamp. A PR often has even a single commit, so why not preserve its original timestamp? I think the current behavior is specially unexpected to "rebase and merge", though.
All reactions