3 ms·
How can a commit time change?
by irishcoffee 7y ago
How can a commit time change?
- dahart 7y agoIt's a different commit. I was talking about introducing and then pushing new commits with different timestamps than the original, not somehow modifying timestamps on a specific commit. The commit that gets pushed can, and often does, have a different timestamp than the timestamp on the commit when the code was written.
- gitrebase 7y agogit commit --amend changes author time. git commit --amend --reset-author changes both author time and commit time. git rebase changes commit time. All three commands can be used just before a merge and push to clean things up. So there is no guarantee that the author time or commit time we see in the final commit history accurately represents the actual time at which the work was done.