How to replace a branch in subversion?

人盡茶涼 提交于 2019-12-08 05:52:26

问题


I'v never used branching till yesterday so I didn't knew that I should make the branch our of the trunk. So I branched a subfolder and this caused some side effects like accidental switching the trunk to branch ... this resulted in overwriting the trunk with the subfolder and deleting everything else inside the trunk = destroying my working copy ;/

Now I'm in the situation that I want to override this problematic branch with my working copy. How can this be performed? I'm using Tortoise SVN.


回答1:


It's easily possible via commandline:
You can switch your working copy back to trunk with svn switch TrunkURL in your local repo.

Use svn remove URL to remove the branch, you then can recreate the branch with the right source. With svn switch branchURL you can switch your local copy to the newly created branch.

With TortoiseSVN:

  • Rightclick on your repo, go into the Tortoise-menu and select Switch. Select your trunk, you will then have your local repo back to trunk.
  • Go into the Tortoise SVN Repo browser, there locate your branch. Right click on it and remove it
  • Recreate the branch by rightclicking your trunk and selecting Copy to...
  • Switch your local repo with the switch command from the first point. This time just select the branch instead of trunk.

No worries, you won't lose any files stored in the SVN. Even your first branching-experiment will stay in there at a certain Revision.



来源:https://stackoverflow.com/questions/15919797/how-to-replace-a-branch-in-subversion

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