Search code examples
tfsvisual-studio-2015

Cant create a branch from a TFS project


I started using TFS and I was not using branches for my project, but now I need to manage releases, so my Idea is to make Branch from the project and for every release create new branch from the main branch.. so

In VS2015 Source Control Explorer, i click on TFS project > Branching and Marging > Convert To Branch and this error happened

TF203028: You cannot create a branch at $/ProjectA because a branch alreadyexists at $/ProjectA/Main. If $/ProjectA/Main is not a branch convert it back to a folder and retry the operation.

the problem is that I don't see any branches in source control manager neither in TFS website, I created empty branch earlier but I deleted it. What to do ? I don't want to create new project with Main branch and copy/paste the source codes because I want to preserve the commits.


Solution

  • In TFS, you never really delete anything. In fact, if you look under Tools -> Options -> Source Control -> Team Foundation Server, there is an option to show deleted items:

    Team Foundation Source Control Settings

    To actually delete an item, have a look at the tf destroy command.

    I believe that you can simple rename the folder, and that will maintain your history, should you not wish to permanently delete the old branch.