简体   繁体   English

将多个提交从一个分支移动到另一个分支?

[英]Move several commits from one branch to another?

I started with branches master and develop.我从分支大师开始并开发。 I made branch foo based off of develop.我基于开发创建了分支 foo。 7 commits later and now I realize I wish i made it off of master. 7 次提交之后,现在我意识到我希望我能从 master 中脱颖而出。 I can cherry pick each commit, no big deal, but is there a slicker way?我可以挑选每个提交,没什么大不了的,但是有没有更巧妙的方法?

Try this.尝试这个。 You can leave off the foo if it's the currently checked-out branch.如果它是当前签出的分支,您可以不使用foo

git rebase --onto master develop foo

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM