开发者

Branch from a branch: moving to a normal branch

I normally create branches from trunk, work on them, and eventually reintegrate them back into trunk.

Sometimes I'll create a branch Y from another branch X, so I can start with X's code. Normally I'll reintegrate Y into X first, then reintegrate X into trunk.

Y --> X --> trunk

But what if I want to reintegrate X into trunk first, and I no longer want Y to 开发者_运维技巧depend on X? In other words, I want Y to be a normal branch, so that I can merge it directly to and from trunk, without going through X.

Y --> trunk
X --> trunk

What should I do? One approach would be to create a new branch, and merge all of Y's changes into it. But I'd like to keep using Y if possible, so I don't lose track of its history. Is that possible?


Subversion does not track any dependencies between branches. It only keeps the history and the history of merges.

When you merge Y to X svn inserts the information about the merge that just happened. When you merge X back to trunk, this information is propagated to trunk. This way, a change will never be applied twice on consequent merges. No matter how these merges were made.

You should just merge X into trunk, and then work with Y like X never existed. Merge in to trunk if you want or just keep working on it whether you want.

In svn branches have no dependencies or whatsoever.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜