by fleekonpoint · 2y ago · 0 comments
git checkout main
git checkout -b squash-branch
git merge --squash [branch-to-rebase]
At this point I usually git diff the two branches as a sanity check before merging back into main: git diff [branch-to-rebase]
git checkout main
git merge squash-branch
I am normally able to squash rebase 99% of the time using git rebase -i main, but doing a git merge --squash into a temp branch has saved me a lot of hassle over the years.No comments yet.