How to squash multiple commits and rebase/merge to another branch

Answered

I have a base main branch and a feature branch. I made some changes on feature branch and had a few commits. In the pass, I used the following steps:

1)in feature branch, rebase to main branch with "squash" selected.

2)fix any conflicts and finish rebase.

3)go to main branch, merge the changes from feature branch.

4)fix any conflicts and finish merge.

5)push main branch to remote.

The above steps make the commit log clean because multiple commits were squashed to one.

Since early this year (maybe last year), looks like the UI has changed? What are the steps to achieve the same result as above approach? I saw there is an option "Squash into". What is this for?

 

Thanks!

 

 

 

 

2 comments
Comment actions Permalink

I actually saw if we selected multiple commits, we had an option to "Squash Commits". Looks like we need do it for each package.

0
Comment actions Permalink

Hello Coyun Mitbbs
You achieve your goal with bringing changes as you described by checking out main branch, then go to Git | Merge. Then choose desired branch to merge and choose under "Modify option" `--squash` flag.

0

Please sign in to leave a comment.