I am trying to create a branch from my local workspace of a checked-out project.
Basic background:
I checked out from the 'trunk' of a project and made a lot of changes.
I now want to check these changes into a new branch.
I created a new branch from within Source Control - but my workspace is still mapped to the trunk.
I followed the steps from an article I found here: Branch from local workspace
So I shelved my changes.
Created a branch.
Used TFPT to migrate from the trunk to the branch
tfpt unshelve "My uncomplete changes" /source:"$/MyRoot/MyProject-Trunk" /target:"$/MyRoot/MyProject-Branch"
Everything looked to go smoothly (except it doesn't seem to support files which have been renamed - so I had to skip them)
But nothing has changed.
The branch is an exact duplicate of the trunk (no local changes included)
My workspace is still mapped to the trunk.
If I check-in, it checks into the trunk.
I tried to unmap the checked-out version I have, delete the local files, then check out the branch, then unshelve the changes I made, but I am flooded with
No appropriate mapping exists for $/Root/MyProject/Myfile.cs
It seems so simple, but TFS seems to add an extra layer of complexity to what was such an easy task in SVN...
Hopefully something stupid I am doing wrong.
Any help appreciated.
In Source Control Explorer, right-click the folder or file that you want to branch, point to Branching and Merging, and then click Branch. The Branch dialog box appears. In the Target box, modify the location and name for the new branch. You can also click Browse to specify a target.
Use the following procedure to create branches in TFS from Visual Studio. Connect to your Team Foundation Server (if you're not already) and open the team project you're working on. Go to the Source Control Explorer.
To start, make sure you've got a previously created or cloned repo open. From the Git menu, select New Branch. In the Create a new branch dialog box, enter a branch name. For branch naming details, see Special characters in branch and tag names.
Try this:
Source Control Explorer
, select Workspace->Workspaces...
from the toolbar.Edit
for your workspace and add a mapping to your new branch, e.g.
Active|$/Root/MyProject-Branch|<My Local TFS Storage>\MyProject-Branch
tfpt unshelve <shelveset> /migrate /source:$/Root/MyProject /target:$/Root/MyProject-Branch
. It should create a new shelveset with mappings changed to your new branch.Btw, in TFS the term is to map a project/branch to a local storage, not 'check out' as in SVN. That term is used for those files you make changes to ;).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With