We work with 3 "main" branches, dev
, uat
, and master
. We then use "feature" branches for any new work, branching from master
, then merging back dev
, PR to uat
, master
.
During the PR to uat
, one dev in particular, sees almost constant merge conflicts on generated CSS (we are using SASS and gulp).
Whilst this sounds unexpected, the diffs are quite surprising:
+<<<<<<< destination:ac815dd…
.strip--beta .card-feed {
background: transparent;
}
+=======
+>>>>>>> source:b49e50b72ee…
or:
@media (min-width: 1024px) {
+<<<<<<< destination:ac815ddf3…
.copy h1 {
Add a comment to this line
+=======
+ .copy > h1 {
+>>>>>>> source:b49e50b72…
font-size: 34px;
line-height: 48px;
}
I don't understand why a simple removal, of a couple of lines, or just a >
would cause a conflict.
Initially, we thought to look at line endings etc. but this is generated…
How would we investigate the cause? Does anyone know why this would be happening?
I guess you have reasons to add the generated CSS to git, so I'll ignore this issue here.
I don't understand why a simple removal, of a couple of lines, or just a > would cause a conflict.
But that is exactly what conflicts are. Git does not care how severe a change is. You can instruct it to ignore certain whitespace changes, but not to treat several linebreaks as one.
The 3-way merge of two commits A and B works like this:
I guess the real question you have to solve is why, if everything else is the same, the generated CSS is different for this developer than another. Maybe he uses different (versions of) tools to generate that CSS, and the (version information of the) tools are outside the repository?