How to use git merge --squash?

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

    Use

    git status 
    

    to check what's going on.

    Then

    git checkout master 
    git merge --squash bugfix
    git add (add which files you want or use wildcard command like ".")
    

    Then

    git commit -m "message"
    

    And now last but not the least

    git push -u origin master
    

    Here origin can be other remote you prefer.

提交回复
热议问题