Move branch to another branch

我只是一个虾纸丫 提交于 2019-12-03 02:31:23

Let's say you've named your branches like so:

    A -- B -- C -- D (master)
     \-- E -- G -- H -- I -- J (current-parent)
          \-- K -- L (my-branch)

What you want to do is rebase my-branch onto the B commit like so:

    git rebase current-parent my-branch --onto B

You could use git rebase --onto, e.g.,

git rebase --onto new-base old-base your-branch

So in your case, something like:

git rebase --onto B E L

should work.

This is just the sort of thing git rebase can do.

https://www.kernel.org/pub/software/scm/git/docs/git-rebase.html

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!