My scenario is that I have one branch in which I\'ve made big improvements to the build process (branch A) and in another I\'m working on a unrelated feature (branch B). So
I just had to do something similar and was able to fix it by adding --squash to the merge command
--squash
git merge --no-commit --squash branchA git reset HEAD # to unstage the changes