Often you have your feature branch you’ve been working on and once it’s ready, you just want it to merge into master as a single commit. You don’t care about all the single commit messages as they may not be relevant. There’s a nice “autosquash” feature in git which we’ll use in this lesson.
After you have done your work in feature branch, let call it 'refactoring'.
Then you need to checkout master branch:
git merge --squash refactoring
We you modify the commit message in the REPL, then save it.
Git will helps to combine all the commits from feature branch into one single commit and merge it into master.