TFS - 从本地工作副本创建一个分支 [英] TFS - Create a branch from local working copy

查看:39
本文介绍了TFS - 从本地工作副本创建一个分支的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试从已检出项目的本地工作区创建一个分支.

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

所以我搁置了我的更改.
创建了一个分支.
使用TFPT从trunk迁移到branch

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

这看起来很简单,但 TFS 似乎为 SVN 中如此简单的任务增加了一层额外的复杂性...
希望我做错了一些愚蠢的事情.

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.

感谢任何帮助.

推荐答案

试试这个:

  1. 您需要在工作区中包含新分支才能看到任何更改(否则您将只能看到签入的版本).在 Source Control Explorer 中,从工具栏中选择 Workspace->Workspaces....
  2. 为您的工作区选择 Edit 并将映射添加到您的新分支,例如Active|$/Root/MyProject-Branch|<我的本地 TFS 存储>\MyProject-Branch
  3. 运行命令 tfpt unshelve ;/migrate/source:$/Root/MyProject/target:$/Root/MyProject-Branch.它应该创建一个新的搁置集,并将映射更改为您的新分支.
  4. 尝试将新的、迁移的搁置集上架到您的新分支上.
  1. You need to include the new branch in your workspace in order to see any changes (otherwise you'll only see the checked-in versions). From Source Control Explorer, select Workspace->Workspaces... from the toolbar.
  2. Select Edit for your workspace and add a mapping to your new branch, e.g. Active|$/Root/MyProject-Branch|<My Local TFS Storage>\MyProject-Branch
  3. Run the command tfpt unshelve <shelveset> /migrate /source:$/Root/MyProject /target:$/Root/MyProject-Branch. It should create a new shelveset with mappings changed to your new branch.
  4. Try unshelving the new, migrated shelveset onto your new branch.

顺便说一句,在 TFS 中,这个术语是将项目/分支映射到本地存储,而不是像在 SVN 中那样签出".该术语用于表示您对其进行更改的那些文件 ;).

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 ;).

这篇关于TFS - 从本地工作副本创建一个分支的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆