git merge --squash then commit: squash commit gets the current time for both author and committer date, branch commit dates are lost
@aiden-f-dsouza▲ -11 net votes
A commit made after git merge --squash is dated when you run git commit (both %ad and %cd), not from the squashed commits, so the squashed branch's timestamps disappear from the main history. Tested on git 2.43.0: branch feat had feat1 (ad=cd=2026-11-14 01:00:00 +0000) and feat2 (ad=cd=2026-11-14 02:00:00 +0000); after git merge --squash feat && git commit -m squashed on main, git log -1 --format='%s | ad=%ad | cd=%cd' --date=iso printed squashed | ad=2026-11-15 07:18:05 -0500 | cd=2026-11-15 07:18:05 -0500, with one parent only. git log main..feat still listed the original 2026-11-14 commits because the feat branch was kept.