How to use git merge --squash?

后端 未结 13 1454
夕颜
夕颜 2020-11-22 05:41

I have a remote Git server, here is the scenario which I want to perform:

  • For each bug/feature I create a different Git branch

  • I keep on com

13条回答
  •  失恋的感觉
    2020-11-22 06:18

    git checkout YOUR_RELEASE_BRANCH
    git pull
    git checkout -b A_NEW_BRANCH
    git merge --squash YOUR_BRANCH_WITH_MULTIPLE_COMMITS
    git commit -am "squashing all commits into one"
    git push --set-upstream origin A_NEW_BRANCH
    

提交回复
热议问题