没有父目录的分支 [英] Branching without a parent directory

查看:76
本文介绍了没有父目录的分支的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我在学习TFS时创建一些项目时,我很草率。  我在没有包含所有源代码和目录的父目录的情况下创建了它们。  我的解决方案文件和包目录直接位于根tfs项目目录下。
 现在我有更成熟的代码,我需要分支这些项目。  我想分支一切,包括解决方案文件和包目录。

I was sloppy when I created some projects when I was learning TFS.  I created them without a parent directory containing all source code and directories.  I have my solution file and packages directory directly under the root tfs project directory.  Now that I have more mature code, I need to branch these projects.  I want to branch everything, including the solution file and packages directory.

我看到这样做的唯一方法是在Source Control Explorer中创建一个新文件夹并进行移动(将所有内容移动到除BuildTemplates之外的新目录中)。  我现在能够分支这个新目录。  除了经常抱怨
关于重命名或移动后查看目录历史的问题,我发现这是可以接受的。  

The only way I saw to do this was to create a new folder in the Source Control Explorer and do a move (move everything into this new directory excluding BuildTemplates).  I am now able to branch this new directory.  Besides the often complained about problem of viewing directory history after a rename or move, I found this was acceptable.  

在分支之前,我使用标签来标记我当前的"发布"。  在理解我糟糕的tfs目录结构之前,我对项目进行了重大更改并多次签入。  我很快意识到我需要一个分支,所以我
可以处理"hotfixes"标记的变更集,我的"释放"或者在并行开发工作。

Prior to branching, I was using a label to mark my current "release".  Prior to understanding my poor tfs directory structure, I made significant changes to a project and checked in many times.  I soon realized I needed a branch so I could work on "hotfixes" to the labeled changeset, my "release" or work on parallel dev.

现在我被卡住了。  如果我转移到新的可分支目录,我无法弄清楚如何使该目录与标记版本相同。  理想情况下,我会有一个Main分支目录,它与我的标签具有相同的来源,以及一个新的
dev分支,它是Main的子代。  自我标记以来,dev分支理想地包含我的所有更改。  

Now I'm stuck.  If I do a move to a new branch-able directory, I can not figure out how to make that directory the same source as the labeled release.  Ideally, I would have a Main branch directory which has the same source as my label and a new dev branch which is a child of Main.  The dev branch would ideally contain all my changes since I labeled.  

这可能吗?  当然,我可以通过蛮力来做到这一点。  创建新目录,将所有内容移入其中,使其成为分支,然后在带有标记代码的标签后覆盖新更改。  然后检查。现在让我的dev分支
再次将更改从label更新到dev。  我希望有一个更优雅的解决方案。  如果没有,我的项目不是很大,所以蛮力方法是可行的。

Is this possible?  Sure I can do it by brute force.  Create the new directory, move everything into it, make it a branch and just overwriting the new changes after the label with the labeled code.  Then check in.  Now make my dev branch and again copy the changes from label to latest into dev.  I hope there is a more elegant solution.  If not, my project isn't huge so the brute force method is do-able.

推荐答案

在将测试项目添加到tfs两天后,我终于对此进行了排序......我认为。

After two days of adding test projects to tfs, I finally sorted this out... I think.

I正试图通过右键单击新创建的分支Main来进行回滚。  我在移动之前无法找到我的变更集。  这是有道理的......我想。  一旦我右键单击根项目文件夹

I was trying to do a rollback by right clicking on the newly created branch, Main.  I was unable to find my changesets prior to the move.  This makes sense... again, I think.  As soon as I right clicked on the root project folder


/ ExampleProject,
我就能够回滚我的标签和移动之间的变更集。  现在我的Main分支看起来像我的标签。  希望我可以创建一个开发分支并在回滚之前看起来像我的原始最新版。 
/ExampleProject, I was able to rollback just the changesets between my label and the move.  Now I have Main branch looking like my label.  Hopefully I can make a dev branch and get to look like my original Latest before the rollback. 

我应该澄清一下,我使用VS社区2013 Update 5. 所有以上是在VS的Source Contol Explorer中完成的。

I should clarify, I using VS community 2013 Update 5.  All of the above was done in the Source Contol Explorer in VS.


这篇关于没有父目录的分支的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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