0

My colleagues and I have just started learning how to collaborate on GitHub. I have been using it for a while, but just on my own for now. When playing around as a team to try and understand some of the processes we stumbled upon an odd problem.

Forgive the visuals below, here are the branches we had:

main ---- raw csv ---- clean csv|
                       newBranch --- analyse clean|

And this is what we did next:

main ---- raw csv ---- clean csv --- delete column in raw csv  ---| merge => No conflicts
                       newBranch --- analyse clean --- --- --- ---|

In other words, someone deleted a column in the original raw csv on the main branch, with the deletion being tracked by git and successfully committed. However, when merging newBranch with the main, there should have been a conflict where the raw csv from main does not match with the raw csv from newBranch, but there was no conflict. The merge was successful and the deleted column from the main was still there.

The raw was in a subfolder, and I looked into .git/info/exclude but everything was default.
Any idea why this is happening? Is there a reason why the changes made were tracked but no conflicts were found?

Adrarc
  • 131
  • 6

1 Answers1

0

Hope both file_name and file_location is the same in both branches. Otherwise git will not track that as a change in the same file.

When git merge happens, for example raw.csv, git walk through the change blocks identified in the two diffs.

  • If both sides of the file have the same change in the same spot, accept either one.
  • if one introduces a change and the other leaves that region alone, introduce the change in the final.
  • if both introduce changes in a spot, but they don't match, mark a conflict to be resolved manually.

In your scenario, delete columns won't introduce changes in same spot. So no merge conflict.

checkout this links for further details. How does 'git merge' work in details?

DevThiman
  • 920
  • 1
  • 9
  • 24