我将放弃当前的开发线并使用另一个存储库中的开发线 - 如何正确处理这个问题?
我目前正在为我协助的课程开发一个多阶段项目。我已经完成了该项目的第一阶段。至于第二部分,我想从我的教授在第一阶段已经完成的代码开始,因为他正在与我们并行进行(实际上,比我们早一点),以确保他要求我们做什么这样做其实是可行的!我教授的代码在另一个仓库中。
现在,我的问题是如何处理这个问题。我的直觉告诉我应该创建一个标签 phase1
并将我当前的主干内容放在那里。之后,我只需擦除主干中的所有内容,并将教授的代码签出到我的硬盘驱动器上的某个文件夹(看来我不能直接将其签出到我的主干文件夹!)。之后,我将复制我刚刚在主干中签出的内容并点击提交。
这是一个正确的近似值吗?我意识到这个会起作用,我只是想知道这是否是完成任务的最干净、最合适的方式!
谢谢
I am currently developing a multi-stage project for a course I'm assisting to . I'm over with the first phase of the project. As for the second part I'll want to start with the code my professor has already done for the first stage, for he is doing it in parallel with us(actually, a bit ahead of us) to make sure what he's asking us to do is actually feasible!. My professor's code is in another repo.
Now, my question is on how to handle this. My gut is telling I should create a tag phase1
and put my current trunk contents there. Afterwards I'll just have to erase all the contents in the trunk and checkout my professor's code to some folder on my hard drive (it seems I cannot just checkout it to my trunk folder directly!). After that, I'll copy what I just checked out in my trunk and hit commit.
Is this a correct approximation? I realize this one will work, I'm just wondering whether this is the cleanest and appropriate way to accomplish the task!
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
svn mv
将您的trunk
发送到其他地方,例如branches/phase1
,然后svn mkdir
一个新的trunk
您可以在其中签入教授的代码,或者将教授的代码svn import
放入新的主干
中。编辑:正如@forsvarir指出的那样,将教授的代码放在自己的分支上可能是个好主意,这样您就可以根据需要从中合并。
因此,在移动原始
trunk
后,svn import
教授代码到branches/professor
(或任何名称),然后svn copy< /code>
branches/professor
到trunk
,这样您就可以在教授更新代码时将教授的更改添加到branches/professor
,然后您可以将这些更改合并到trunk
。svn mv
yourtrunk
to sometwhere else, likebranches/phase1
, thensvn mkdir
a newtrunk
where you can check in your professor's code, orsvn import
your professor's code into a newtrunk
.Edit: As @forsvarir points out, it's probably a good idea to put the professor's code on its own branch so you can merge from it as needed.
So after moving your original
trunk
,svn import
the professors code tobranches/professor
(or whatever name), andsvn copy
branches/professor
totrunk
, this way you can add the professors changes tobranches/professor
as he updates his code, and you can merge those changes totrunk
.如果我这样做...
我会将主干设置为教授的开发线。每次教授给你一个新的代码时,相应地更新这个版本,然后将其分支用于你自己的开发(作为阶段 XXXX)。这样,代码中就会有一个明显的流程来说明如何到达每个点。我希望如果您这样做,您应该能够检查您的主干,然后直接从教授的存储库合并更改(从您上次进行的修订开始,一直到教授可能标记为开始的修订)下一阶段)。
根据您当前的设置,我将遵循@Christoffer 建议的方法。
If I was doing this...
I'd set up the Trunk as the Professor's development line. Each time the Professor gives you a new drop of code, update this version accordingly and then branch it for your own development (as phase XXXX). That way, there's an obvious flow through the code for how you got to each point. I would expect if you did this, you should be able to check out your trunk, then merge the changes directly from the Professor's repository (starting from the revision you last took, and up to the revision that the Professor has presumably tagged as the start of the next phase).
With your current setup, I'd follow the approach suggested by @Christoffer.