Sven Eppler
Sven Eppler

Reputation: 1706

Git merge parallel feature branches

i try to work with git like described in the A succesfull git branching model. Today i started to work on "Feature A". While developing for it, it quickly became clear i need another "Feature B" to make my life easier. So "Feature A" depends on "Feature B". I therefore created a new branch for "Feature B" and implemented it. But how do i now proceed? Do i merge Feature B into Feature A? Do i merge Feature B into Development and "re-merge" development into Feature A? Or do i merge "Feature B" into "Feature A" and development?

Any ideas? Suggestions?

Upvotes: 2

Views: 2670

Answers (2)

chaiyachaiya
chaiyachaiya

Reputation: 2717

If you see the illustration of the mentioned gitBranching model you can notice that we always merge branch with the direct ancestor branch.
E.g: All feature branches created from the "develop" branch are merged with the "develop" branch and no other branch.

I guess you created the "feature B" branch from the "feature A" (i.e from "feature A": git checkout -b "feature B"). To follow the pattern you ought to merge it with "feature A" branch and no other branch, even develop branch.

Moreover "feature B" make sens only for "feature A" branch. Merging it with another branch will hide the reason behind its creation (that is, I created feature B because I needed it to implement feature A).

Upvotes: 2

m110
m110

Reputation: 1

If "Feature A" depends on "Feature B" then merging B into develop makes no sense, so you probably want to merge it to A first. If the changes from B were made only for new code from branch A, then you might consider skipping B and simply commiting them on A.

Upvotes: 0

Related Questions