exebook
exebook

Reputation: 33980

Does git merge take into account timestamps on merged files?

When merging two files, does git take into account which file is newer and which one is older? If yes, what happens with timezones, what if one user has an older file but their timezone makes it look newer?

Upvotes: 4

Views: 677

Answers (1)

VonC
VonC

Reputation: 1329202

so can the timezone delta be a problem with commit timestamps

No: only the graph of commit matters, whatever their associated date is.
A commit can in theory have a parent commit created after said commit (instead of before): the date is an arbitrary metadata you associate to a commit when you create it, like the author string. (see for instance the GIT_AUTHOR_DATE and GIT_COMMITER_DATE environment variables)

The recent (Q2 2018) commit-graph feature from Microsoft does not depend on dates at all, for instance. (see Git Commit Graph Design Notes)

See more with "“Chronological” ordering: time is an illusion; log time, doubly so".

Upvotes: 5

Related Questions