Consequences of not using --reintegrate with svn merge back to trunk

时间秒杀一切 提交于 2019-12-21 15:27:50

问题


I'm new to subversion. Over the last month I had done some changes and merged them to trunk. Everything seemed fine - my changes got propagated as expected. But today I was re-reading about merging and saw this, saying the following when merging your changes back to trunk:

Now, use svn merge with the --reintegrate option to replicate your branch changes back into the trunk.

and a few paragraphs later:

Notice our use of the --reintegrate option this time around. The option is critical for reintegrating changes from a branch back into its original line of development—don't forget it!

I guess I hadn't read things carefully enough the first time around.

So, it seems I made a mistake with my previous merges back to trunk because I hadn't used the --reintegrate option. What are the consequences of this? Is there something I need to fix?

In case it's useful, my work flow had looked like this:

  1. Copy from trunk to create a personal branch.
  2. Check out the personal branch.
  3. Changes and commits.
  4. Get a working copy of trunk.
  5. Merge my branch to the working copy of trunk (again, without --reintegrate).
  6. Commit the merge.
  7. Delete my branch.

回答1:


Your workflow is fine if your branch is very short-lived.

If it has a longer life, you'll want to regularly merge changes from the trunk into your branch, to avoid being disconnected from the main branch of activity.

In the end, your feature branch will contain every change from the trunk since you created the branch, + the new feature you developed in the branch. At this time, you need to use the reintegrate option, because it would be wrong to apply the changes of your branch to the trunk: it would reapply changes that are already in the trunk, since they originate from it.

This is well covered in the section of the SVN book about feature branches.



来源:https://stackoverflow.com/questions/11691897/consequences-of-not-using-reintegrate-with-svn-merge-back-to-trunk

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