Moving source, labels, and history in TFS 2010 from root folder into a branch

霸气de小男生 提交于 2019-12-07 15:03:36

问题


I've got a situation that I'm not sure if I can work around.

I've recently started on a new team that had never used any type of Version Control system, and our organization uses TFS as a standard (which I'd never used before).

After a lot of pleadind, I got the admins to creat a TFS project for my existing code on our server, and since none of my project's code had ever been checked in (after many years of existence), I wanted it in version control asap, so I checked my project into the root folder of the project. Not having read the Branching Strategy at http://tfsbranchingguideiii.codeplex.com/ I hadn't setup "Main" and "Release" folders in my main project.

At the time, I had separate folders on my local workstation containing the different releases we had made. I checked each version in, labeled it with the release number, and then checked the next version in on top of that.

I'm now running into an issue/bug with one of my previous releases and I'm trying to branch off a label in order to make some changes in one of my releases. TFS throws an error that I can't create a branch in that location (because all of the source in under the main project folder).

I've tried creating a "Main" and "Releases" folder, and then moving all the source under the Main folder, but the trouble is that the history and labels are pinned to the original location which is the root folder. If I try to branch off a label, the label doesn't exist in the "Main" folder that I moved the code to, but rather where it was created (in the root).

As such, TFS is still trying to branch from the root folder when I attempt a branch from the label.

My question is this: As an administrator for the server, is there a way to move everything (source, history, and labels) from their original location?

Thanks!


回答1:


I don't think you can "move" the history and the labels. As you say, they're bound to the original source location. A move is effectively a rename.

In my experience, even renames of folders to folders that were deleted have caused those new folders to acquire the deleted folder's history.

Have you considered branching your current team project into another team project while observing the folder structure that you want in the new team project.

Create a new team project with the folder structure you want. E.g.:

  • /NewTeamProject
    • /Main (branch into here)
      • /Src (or whatever your root source folder is)
      • /Doc
    • /Releases

You can then keep the old team project around for "insurance".

It shows how helpful it is to have a reasonably thought-out folder structure.



来源:https://stackoverflow.com/questions/7954401/moving-source-labels-and-history-in-tfs-2010-from-root-folder-into-a-branch

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