Let's suppose I need to perform some average-length (several days) refactoring.
I create "mybranch" from master, do the work, sometimes I perform merges from master to mybranch (some other team members supposed to continue the work, and probably I'll need to get their changes). And after a while I'm ready to merge my changes back to master.
Will I be able to squash only my changes (excluding the changesets with merges from master, since they aren't mine) and cherry-pick a single result commit of my works into the master? Is it a possible to do scenario?
Yep. You can confirm it with a small test repository. Just do:
git rebase --interactive master mybranch
and choose squash
for all the lines except the first. Then you just checkout master
and do a regular fast-forward merge of mybranch
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With