Rebase a single Git commit

后端 未结 5 1298
一个人的身影
一个人的身影 2020-12-22 18:00

Is there a way to rebase a single commit from a branch onto another branch?

I have this branch structure:

-- -- -- -- -- (Master)
            \\
           


        
5条回答
  •  难免孤独
    2020-12-22 18:35

    You can cherry-pick XX to master.

    git checkout master
    git cherry-pick 
    

    And remove the last commit from the feature branch with git reset.

    git checkout Feature-branch
    git reset --hard HEAD^
    

提交回复
热议问题