WHAT IS A GIT SQUASH MERGE? HOW TO USE IT?

What is a git squash merge? How to use it?

Advantages:

This will take all the commits from the bugfix branch, squash them into 1 commit and then merge it with your master branch. … git checkout master git mergefeature1 feature2 feature3 etc. The last merge is an “octopus merge” because it’s merging a lot of branches at once

You can follow the below commands to use Squash:

git checkout master
git merge –squash bugfix
git commit
This will take all the commits from the bugfix branch, squash them into 1 commit and then merge it with your master branch.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>