A lot of work was done on a feature branch, and during this time, there were multiple commits on the branch but also merge commits with changes from the main branch.
Now the feature branch has commits like this:
- Work 6 (done on the feature branch)
- Work 5 (done on the feature branch)
- Work D (done on the main branch)
- Work C (done on the main branch)
- Merge branch 'main' into 'feature'
- Work 3 (done on the feature branch)
- Work B (done on the main branch)
- Work A (done on the main branch)
- Merge branch 'main' into 'feature'
- Work 2 (done on the feature branch)
- Work 1 (done on the feature branch)
Now there is a pull request created on the GitHub repo, but it's hard to follow through the all the changes and approve it.
What I would like is to squash commits made on the feature branch, such that I will have just one nice commit which I need to review.
How can I do that?
I've read about squashing changes and rebasing, but I need some help.
Can I just call rebase -i [commitnumber]
where commit number is of Work 1
?
I used this on feature branches and it worked great but not when merge commits exist.