I did a code format in master branch. It mainly fixed whitespace issues like: formatting tab space lengths, adds and removes newlines before and after braces. The problem is, when I try to merge master from other branches I get a lot of conflicts. Is there some strategy to bring in whitespace changes to other branches?
Merge strategy for whitespace only changes?
Asked Answered
From the docs of git merge
, I would assume that
git merge -s recursive -Xignore-space-change
could be used to achieve this. You might also want to play around with
-Xignore-all-space
or-Xignore-space-at-eol
This helped a lot. However, conflicts still ocurred. It was much easier to resolve them when I did code format in both branches first and then merged them with the above method. –
Theodoratheodore
For those who are wondering why this solution doesn't work, it was not introduced until 1.7.4 raw.github.com/gitster/git/master/Documentation/RelNotes/… –
Tayib
© 2022 - 2024 — McMap. All rights reserved.