If you really are only concerned with the dates, git show HEAD
should provide you the date and time of your HEAD. If you need more detail about specific lines, git blame <filename>
should help you find the relevant commits, and then you can use git show <commit>
to find those dates and times.
Similarly, for the "some meaningless commit message", that line should contain a SHA-1 hash which you can also use with git show <commit>
to find the date and time of that commit.
However, it is worth reiterating that in most cases, it is far more important to examine the content of the conflicting commits and to make a decision based on that.
Edit after further research: It is possible that there is a merge strategy (git merge -s <strategy> [-X <strategy-option>]
) that would do the merging automatically based on timestamp, but I have not been able to find such an option in the documentation.
Edit after even more research: See here for a similar yet less contentious SO question that might relate to your interests. You may not want an automated process, and the solution there may not work for your situation, but perhaps the custom merge driver offered there will help you.