Squash all of my commits into a single one and merge into master

Share this video with your friends

Send Tweet

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.

Phillip
Phillip
~ 5 years ago

Although Juri pointed out the branch wasn't actually merged per-se (only the steps turned into a new commit), the result is that you can't just git branch -d app-refactoring because it hasn't been merged (Of course you can do git branch -D app-refactoring). This is different than if you had just done git merge app-refactoring at the beginning.

Juri Strumpflohner
Juri Strumpflohner(instructor)
~ 5 years ago

@Philip totally, I agree. Alternatively you'd have to do it in separate steps, like polishing your branch commits first (also with autosquash in case) and then doing a normal merge.