How to merge multi commits to one commit

Merge all diff commits in another branch

Firstly, we should start working new feature/bugfix on a new branch and commit as much as we want.
After finished coding, we can merge them to master branch with one combination commit using merge –squash command
# switch to master branch
$ git merge --squash <feature branch>

Comments

comments powered by Disqus