Ashok
Ashok

Reputation: 65

Creating a new branch (B) from an existing feature branch (A) and merging the old feature branch (A) into develop

Suppose, I have a feature branch (A) that I created from the develop branch and then I create another feature branch (B) from A - can I then decide to merge A back to the develop branch and continue working on branch B and then merge B back to develop? Is that even recommended or are there any potential issues?

Upvotes: 0

Views: 49

Answers (1)

eftshift0
eftshift0

Reputation: 30212

It's not recommended or anything... it's just a thing you can do and there's no reason not to do it, as long as you are careful as to what revisions make up each feature when you move them around.... think: when rebasing.

So... just to exemplify.... if you wanted to separate feature b from feature a at a given moment in time, you could do so by doing this:

git rebase --onto some-branch featurea featureb

You are asking git to move the revisions that make up featureb, disregarding revisions from featurea, on top of some-branch.

Upvotes: 1

Related Questions