Replacing a forked project with the current version of the Trunk project in SVN

I have a \ trunk \ root \ which contains ProjectA, ProjectB folders, etc. I created a root branch -> \ branch \ task \ root \

Now I have made significant changes to the projects in the task, including ProjectB.

However, \ trunk \ root \ ProjectB also moved to a point that makes all changes to the \ Root \ ProjectB task redundant.

I would like to completely replace the contents of \ branch \ task \ root \ ProjectB with the contents of \ trunk \ root \ ProjectB. Without merging, just make the ProjectB task version identical to the trunk version. Pay attention when it comes to merging tasks back into the body. I don't want a strange event happening in ProjectB. SVN should just see that this is an old version of what is now in ProjectB, and does not change anything.

Can someone run the know-how of SVN β€” nothing like me (who also happens to be a complete whimp) CLI using TortoiseSVN to achieve this?

0
svn tortoisesvn
source share
4 answers
  • Delete the current ProjectB on the branch, do it on svn repo
  • Copy the ProjectB trunk to this branch location (where ProjectB used to be).
  • Revert or, better yet, recheck ProjectB.

That is, if you lose the story.

An alternative approach in which the story will be saved, but this will use the Eclipse IDE

  • Checkout ProjectB from the outside
  • Checkout ProjectB from branch (to another project in Eclipse)
  • Compare the two versions of ProjectB and make any changes from the trunk project B to the ProjectB branch
  • Checkin B Branch Project
+3
source share
  • Switch working copy to /branches/task/root/ProjectB (or checkout new WC from this URL)
  • Right click and select Merge
  • Choose Merge two different trees
    • From: /branches/task/root/ProjectB
    • To: /trunk/root/ProjectB
  • Leave the rest of the default options and click Merge (or Test merge )
  • Resolve any conflicts by selecting a trunk file version

This will lead to the necessary changes so that your branch is the same as the trunk. Then you can commit.

+3
source share

In the turtle, you can right-click and execute the equivalent of "svn delete", i.e. delete the branch you want to kill.

Then you need to make a copy of Tortoise and place the new path.

0
source share

Usually, you should regularly re-integrate changes made in the trunk into the branch to avoid this situation.

Why don't you keep your previous branch and create a new one instead? A version in a structure is very often used, for example:

 branches/task/version1.0 branches/task/version2.0 tags/task/version1.0 tags/task/version2.0 trunk 

To do this using TortoiseSVN, move the branch to:

  • opening repo browser (context menu, TortoiseSVN β†’ repo-browser )
  • creating a directory branch / task / version1.0 ( Create folder for the task)
  • renaming branches / tasks to branches / task / version 1.0 ( Rename to task)

Then you can act as usual:

  • (context menu in the paged trunk directory) TortoiseSVN β†’ Branch/Tag
  • specify To URL new branch (branch / task / version2.0)
  • indicate whether you want to create a new branch from a working copy or to another location (I would strongly recommend moving the branch from HEAD first too).

(alternatively, you can use the repo browser and make Copy to from the outside line)

When the tools warn you, you still have to switch:

  • (context menu in the same directory) TortoiseSVN β†’ Switch
  • specify To URL new branch (branch / task / version2.0)

You will have something much cleaner.

If you decide to remove the branch anyway, you will avoid confusion during the merge by specifying the range of changes for the merge (one of the fields to be filled in by TortoiseSVN). Remember to exclude anything related to the remote branch. But honestly, I would avoid that.

0
source share

All Articles