stdcerr
stdcerr

Reputation: 15598

how to update the base of a sub-branch

In our repository, we want to develop a feature and keep it in its branch(branchX) until finished. Multiple people are working on this one branch and have sub-branches of it. PRs from the sub-branches will get merged into branchX. Now, a feature from sub-branchA is finished and got merged, how can now all other sub-branches pull-in that change?

On branchB (that started before the feature from branchA got merged into branchX) I have tried git rebase branchX but it doesn't seem like it changes anything or pulls in any data. How can I get branchB updated with the commits from branchA that now got merged into branch X?

tree:

                      - branchA -
          - branchX -/           \- branchA (branchA got merged into branchX)
master - /           \
                      - branchB (how do I pull the changes that branchA introduced into branchB)?

Upvotes: 0

Views: 2261

Answers (2)

AGrigorii
AGrigorii

Reputation: 152

Probably the most true way is to execute git pull --rebase origin branchX, because for common case you should not know, what other subBranch was merged into branchX, you will just get all actual changes.

Upvotes: 2

eftshift0
eftshift0

Reputation: 30156

You checkout branchB and then run:

git rebase branchA

git rebase branchX should work as well. Perhaps you should add one of those ascii trees explaining where the branches are in relation to each other?

Upvotes: 1

Related Questions