In my team, we use git branching to keep different features separate (of course). However, one co-worker insists on keeping these features in different files as well to avoid merge conflicts. For example, we may have a FormView.java
on master, but in have both a FormView.java
and a ValidatedFormView.java
on the form-validation
branch. I suggested that rather than duplicating files to "work around" git, we should let git do its thing and merge features when we want to. He also wants to keep duplicates in order to be able merge some parts of a feature into other branches without having to deal with merging the FormView.java
file itself.
What should we do? If he is right, why? If I am right, how can I convince him as such?
However, one co-worker insists on keeping these features in different files as well to avoid merge conflicts.
-- No, that is a bad idea, unless the intent is to actually create a new feature that co-exists with the original. The way to minimize merge conflicts is to keep more than one person from working on the same file at the same time. In other words, coordinate your efforts. Your coworker needs to stop trying to work-around the way Git works.