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

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.

posted @ 2019-03-25 21:30  Zhentiw  阅读(188)  评论(0编辑  收藏  举报