0

While resolving conflicts in git - If there is any chance of knowing that latest commit in timeline would be beneficial, as latest commit in the timeline may be the appropriate in case of others code.

Do Nhu Vy
  • 33,131
  • 37
  • 143
  • 202
HydTechie
  • 670
  • 8
  • 17
  • Can you explain more? What is the scenario here for a Git conflict? – Tim Biegeleisen Nov 25 '20 at 15:03
  • When there is a conflict of a file, which is not owned by you, but you would like to accept the latest (according to Timeline) change as final.. How do we see timelines of the file in both branches at the conflict site.. – HydTechie Nov 25 '20 at 15:42
  • Does this answer your question? [Need help to understand merge conflict example](https://stackoverflow.com/questions/24103490/need-help-to-understand-merge-conflict-example) – caramba Nov 26 '20 at 03:20

1 Answers1

0

For example, you (developer B) have conflicting at file foo.txt . It means

  • At sometime, foo.txt in many developer PCs are the same.
  • Developer A make change to foo.txt then commit, push it to git server.
  • You commit file foo.txt at your local machine. You catch error something like this: "You need pull first".
  • Then you pull source code from git repository.
  • Error conflict happen at file foo.txt.

As I understand, you need get the change time of file foo.txt what changing made by A and B, then compare. It has no meaning. The key fact at here is, Should you keep these parts and remove other parts?, not depend on the time of changing. Therefore, you should not bear in your question also its answer.

Do Nhu Vy
  • 33,131
  • 37
  • 143
  • 202
  • If its your code, you would understand what to keep, but If the file is modified by others, when you merge MASTER and your DEV1, Dev2 Branch code.. you may have conflict on which you DONT OWN.. in that case, atleast TIMELINE will give a confidence that Latest code to merge...(thanks for your efforts though) – HydTechie Nov 27 '20 at 17:05