如何备份更新的源代码文件
我使用 svn 作为 Visual Studio 2010 的 AnkhSVN 2 的源代码控制。我经常处理一张票证,而不是在没有完成第一个票证的情况下切换到另一张票证。有没有快速的方法来备份第一张票证的更新文件?这将通过仅管理相关更改来简化编码。
I am using svn as source control with AnkhSVN 2 for Visual Studio 2010. Very often I am working on one ticket than switching to work on another ticket without completing first one. Is there any quick way to backup updated files for first ticket? This will simplify coding by managing only related changes.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
您可以
You could
我要问的问题是“软件是否可以构建”。如果是,请将其签入源代码管理。如果没有,请将其置于可以的状态,并将其签入源代码管理。
您不必签入主干,您始终可以有一个用于中间代码的分支,然后在完成票证后将其签入主干。
The question I'd be asking is "Does the software build". If it does, check it in to source control. If it doesn't, get it into a state where it does, and check it in to source control.
You don't have to check into the trunk, you can always have a branch that you use for intermediate code which then gets checked into the trunk when you've completed the tickets.
您应该使用 功能分支< /a> 对于每张票证,完成后将每个分支重新集成到主干中。只需确保阅读 SVN 书籍以了解使用功能分支时的最佳实践,尤其是定期从主干合并到功能分支,然后最后使用
--reintegrate
选项。您还可以创建一个补丁,将其保存在某处,恢复所有内容,然后开始处理 Ticket2。但它很脆弱:您会忘记补丁在哪里,丢失它们,或者由于第二张票上的工作引起的冲突而很难应用它们。而且从一张票切换到另一张票也更困难。恕我直言,功能分支是最合适的解决方案。
You should use a feature branch for each ticket, and reintegrate each branch into trunk once finished. Just make sure to read the SVN book to understand the best practices when working with feature branches, and particularly to regularly merge from trunk to the feature branch, before finally reintegrate the feature branch into trunk with the
--reintegrate
option.You could also create a patch, save it somewhere, revert everything, then start working on ticket2. But it's fragile: you'll forget where your patches are, lose them, or have a hard time applying them because of conflicts caused by the work on the second ticket. And it's also harder to switch from one ticket to another. Feature branches are the most appropriate solution for this, IMHO.