如何备份更新的源代码文件

发布于 2024-11-30 15:36:25 字数 131 浏览 1 评论 0原文

我使用 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 技术交流群。

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

发布评论

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

评论(3

长安忆 2024-12-07 15:36:25

您可以

  1. 为您正在处理的 svn 分支创建一个补丁文件,
  2. 恢复您的更改
  3. 然后在新票证上
  4. 工作并提交重新应用补丁

You could

  1. create a patch file for the svn branch you are working on
  2. then revert your changes
  3. work on new ticket and commit
  4. reapply patch
桃扇骨 2024-12-07 15:36:25

我要问的问题是“软件是否可以构建”。如果是,请将其签入源代码管理。如果没有,请将其置于可以的状态,并将其签入源代码管理。

您不必签入主干,您始终可以有一个用于中间代码的分支,然后在完成票证后将其签入主干。

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.

飞烟轻若梦 2024-12-07 15:36:25

您应该使用 功能分支< /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.

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