Break a previous commit into multiple commits

前端 未结 14 2115
渐次进展
渐次进展 2020-12-20 13:09

Without creating a branch and doing a bunch of funky work on a new branch, is it possible to break a single commit into a few different commits after it\'s been committed to

14条回答
  •  没有蜡笔的小新
    2020-12-20 13:44

    Here is how to split one commit in IntelliJ IDEA, PyCharm, PhpStorm etc

    1. In Version Control log window, select the commit you would like to split, right click and select the Interactively Rebase from Here

    2. mark the one you want to split as edit, click Start Rebasing

    3. You should see a yellow tag is placed meaning that the HEAD is set to that commit. Right click on that commit, select Undo Commit

    4. Now those commits are back to staging area, you can then commit them separately. After all change has been committed, the old commit becomes inactive.

提交回复
热议问题