How to use git merge --squash?

后端 未结 13 1449
夕颜
夕颜 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:00

    Merge newFeature branch into master with a custom commit:

    git merge --squash newFeature && git commit -m 'Your custom commit message';
    

    If instead, you do

    git merge --squash newFeature && git commit

    you will get a commit message that will include all the newFeature branch commits, which you can customize.

    I explain it thoroughly here: https://youtu.be/FQNAIacelT4

提交回复
热议问题