Does TFS branching have a child parent relation?

余生长醉 提交于 2019-12-19 10:52:44

问题


When doing branches in tfs, does it matter if you are branching A to B or from B to A? The thing is that we have branch A and branch B, and now branch A has got messed up and we would like to recreate it from branch B by branching a new branch from B. As far as I know when you do a branch you get a relationship between the branches, but you don't get a "parent-child" relation, is that correct?

Is my question clear?


回答1:


At the point where a new branch is constructed, it gets equal to what you chosen to branch out from.
The tricky point about TFS-merging (as opposed, for example to the P4 intergration, or ClearCase merges) is that at any given point merging A-->B & B-->A will not generate the equal amount of merge candidates.

Let's say branch A generates branch B:

------->A
         \
          \
           -----> B

Let's say you make changes in A:

------->A-->A'
         \
          \
           -----> B

If you try to merge A' --> B you will get as merge candidates all your changesets/source files that were changed from A-->A'.
But if you try to merge B --> A' you will get no merge candidates at all.

This behavior is regardless of fact that A is 'parent'.

If your 'A' is messed and cannot be rectifed with regular merge from B-->A, you have the following options:

  • Destroy A and generate a fresh copy of B in a new branch C
  • Rollback changes from A, until it reaches 'stable'
  • Perform a baseless merge from B-->A and force B-state on A

(Possible slightly off-topic, but an excellent read nevertheless - and valuable for my grasping of the TFS-way: This article by R.Banks)



来源:https://stackoverflow.com/questions/7510089/does-tfs-branching-have-a-child-parent-relation

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!