The short story is : I have created Branch A out from the Develop Branch then I created Branch B From Branch A
Let's say that your current branch diagram looks something like this:
develop: A -- B
\
branchA: C -- D -- E
\
branchB: F -- G
You want the B branch to look like this:
develop: A -- B
\
branchB: F -- G
Rebase onto can be used here:
git rebase --onto B E
In plain English terms, the above command says to place the commit whose parent is E
, which is the F
commit (and the start of the B branch) onto a new base which is commit B
in the develop
branch.
You are looking for git rebase --onto
, since what you want to do is basically rebase only the commits from branch B
onto develop
.
There is a very good description of rebasing in the official git documentation. See section More Interesting Rebases for an example like yours.
Your example would be solved by
git rebase --onto develop branchA branchB
.
Also see the git rebase documentation.