How do I prevent an automerge using Git?

前端 未结 5 1474
孤独总比滥情好
孤独总比滥情好 2020-11-28 20:47

I am trying to merge a local branch into the master branch without having Git to do an automerge. I would like to “hand pick” what I would like to be merged into master.

5条回答
  •  广开言路
    2020-11-28 21:36

    git merge --no-commit --no-ff 
    

    does it.

    When you executed it, the changes from local-branch are applied but not yet staged.

    Then, you could look at the changes to be applied and –  in case that you want to take them all  – apply them with

    git commit -a 
    

    Otherwise, select the files to be taken, stage them with git add and finally commit them with git commit. Restore the unwanted files then with git checkout -- filename.

提交回复
热议问题