从本地工作区分支

发布于 2024-09-19 22:37:16 字数 232 浏览 4 评论 0原文

我正在开发团队项目,突然意识到我做了很多更改,我需要创建分支。

我从未在 TFS 中使用过分支,当我看到“分支\”来自工作空间版本”时,我想这就是我所需要的。但是这个选项并不像我想象的那样。

我如何从我的“本地”创建新分支项目的副本”并包括所有本地更改”?我上面提到的选项创建了类似分支的东西...我不知道确切的分支是什么,但我确信,这不是来自我的本地版本的所有更改。正如我注意到的,生成的分支没有我添加的文件和项目。

I was developing team project and suddenly realised that i've made so many changes, that i need create branch.

I've never used branching in TFS and when i saw "Branch\ "From Workspace version" i thought that's, what i need. But this option doesn't act as i supposed.

How can i create new branch, from my "LOCAL COPY of Project" and include all local changes"? The option that I mentioned above creates something like branch from...i don't know exacly from what, but i know for sure, that not from my local version with all changes. As i noticed, generated branch doesn't have files and project which i added.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

美煞众生 2024-09-26 22:37:17

我要做的是:

  • 将您的工作
  • 分支从适当的源文件夹中
  • 搁置使用 TFS Power Tools 将搁置到其他位置
  • 签入。

这样,您将获得一个干净的分支,并获得所做更改的记录。

What I would do is:

  • Shelve your work
  • Branch from the appropriate source folder
  • Use TFS Power Tools to unshelve to a different location
  • Check in.

That way, you get a nice clean branch, and you get a record of the changes you have made.

寻找我们的幸福 2024-09-26 22:37:17
  1. 下载并安装 TFS Power Tools
  2. 搁置您的工作并记住名称
  3. 从您一直在使用的主干创建目标分支
  4. 映射新分支并获取代码的本地副本
  5. 打开 Windows PowerShell 并更改到原始源代码的目录
  6. 运行以下命令替换搁置集名称以及您自己的目录结构:

    tfpt unshelve /migrate "MyShelveset" "/source:$/project/trunk" "/target:$/project/branch" 
    

如果搁置集名称包含空格,则需要在搁置集名称周围加上引号)

这应该可以帮助您避免我在使用时遇到的一些问题试图遵循最初的指示。

  1. Download and install TFS Power Tools
  2. Shelve your work and remember the name
  3. Create your destination branch from the trunk you've been working in
  4. Map your new branch and get a local copy of the code
  5. Open Windows PowerShell and change to the directory of the original source code
  6. Run the following command replacing the Shelve set name and directory structure with your own:

    tfpt unshelve /migrate "MyShelveset" "/source:$/project/trunk" "/target:$/project/branch" 
    

(quotes around shelveset name are required if it contains spaces)

This should help you avoid some of the problems I ran into when I was trying to follow the original instructions.

故人的歌 2024-09-26 22:37:17

Robaticus 的答案是正确的,但我想添加一些我在其他地方没有明确说明的细节。我只需要这样做,它看起来好像有效,但事实并非如此。它会假装自动合并或复制,但没有创建文件,也没有在新分支中进行签出。应该会引发错误,但没有出现任何错误。

事实证明,如果路径没有空格,则源和目标周围的引号是可选的,但如果存在空格,则它们是必需的。

这是一个模板:

tfpt unshelve MyShelfsetName /migrate "/source:$/MyPath/My Path with spaces/MyBranch" "/target:$/MyPath/My Path with spaces/MyOtherBranch"

Robaticus's answer is correct, but I wish to add some detail that I haven't seen explicitly stated elsewhere. I just had to do this and it acted like it was working but it wasn't. It would pretend to automerge or copy, but no files were created, and no checkouts were made in the new branch. An error should be raised, but none appears.

It turns out that the quotes around the source and target are optional if the paths have no spaces, but they are required if spaces exist.

Here's a template:

tfpt unshelve MyShelfsetName /migrate "/source:$/MyPath/My Path with spaces/MyBranch" "/target:$/MyPath/My Path with spaces/MyOtherBranch"
单挑你×的.吻 2024-09-26 22:37:17

您可能想尝试一下这个:
我假设您正在使用 Eclipse IDE 和 TFS 插件。您需要成为该项目的 TFS 管理员。

  1. 在工作空间中打开项目并右键单击它,
  2. 您会在菜单中看到“团队”。
  3. 在“团队”的扩展菜单中选择“共享项目”
  4. 输入团队 Foundation Server 详细信息以连接它,并选择适当的分支/项目来进行更改。您还可以通过 TFS 控制面板创建一个新文件夹。

  5. 共享所选分支/文件夹中的项目。

(这只是将项目添加到 TFS - 您需要立即检查)

  1. 再次右键单击该项目。
    在“团队”菜单中,您会找到签入更改选项。
  2. 单击它,您的更改将发送到服务器。

干杯!

You may want to try this one:
I am assuming you are using Eclipse IDE and TFS Plugin. You need to be a TFS Administrator for the project.

  1. Open the project in work-space and right click on it
  2. you will notice "Team" in the menu.
  3. select "Share Project" in the extended menu of "Team"
  4. enter team Foundation Server details to connect it and select the appropriate Branch/Project to put your changes. You can also create a new folder by TFS Control Panel.

  5. Share the project in the selected branch/folder.

(THIS IS JUST ADDING PROJECT TO TFS-YOU NEED TO CHECKIN NOW)

  1. right click on the project again.
    in the "Team" menu you will find checkin changes option.
  2. click on it and your changes will be sent to Server.

Cheers!

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文