DEV Community

Discussion on: A quick guide to squashing Git commits

Collapse
 
kip13 profile image
kip • Edited

I'm always use this line to merge from another branch:

git merge --squash feature_branch

If you have conflicts and you trust in the changes of feature_branch, I mean you know the changes in the feature_branch are the correct, you can tell to git that take this confidence changes over the master or another branch where you need to apply the merge:

git merge --squash feature_branch -X theirs

In the other side:

git merge --squash feature_branch -X ours

And continue with the normal flow....

This is called "Strategy option"

Collapse
 
michaelgv profile image
Mike

Curiosity: In the event you have two branches you’ve been handed via a new project, which one can you trust as the source of truth? Typically I’ve trusted the most recent branch, but found that older branches have some better days than newer ones. Thoughts?

Collapse
 
sehetw profile image
sehe

I look at the contents. In the event that I'm unable to reach a verdict which one is better, I trust neither