与普通 svn 客户端相比,使用 git-svn 有何优势?

发布于 2024-11-02 16:24:15 字数 545 浏览 1 评论 0原文

我最近看到很多帖子建议,如果您必须使用 SVN 存储库进行团队开发,那么 git 是比 svn 更好的客户端:

这些文章似乎专注于如何使用,而忽略了原因。 帮助我说服自己、老板和同事,使用 git-svn 比官方 svn 客户端更有优势!

注意:git 和 svn 的相对优点已经得到很好的阐述。我更关心这个问题:在规定的 SVN 存储库上使用哪个客户端。

I've seen a number of posts recently suggesting that if you have to do team development with an SVN repository, git is a better client than svn:

These articles seem to focus on the how, and skimp on the why. Help me convince myself, boss, and peers that there's advantages to using git-svn over the official svn client!

Note: The relative merits of git and svn are well addressed. I'm more concerned in this question with which client to use on a stipulated SVN repository.

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

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

发布评论

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

评论(2

樱娆 2024-11-09 16:24:15

对我来说,使用 git-svn (和 CVS 桥)的主要优点是

  • 我在本地拥有用于浏览和 git-blame 的所有历史记录,
  • 我拥有完整的版本控制当离线时,例如在火车上,
  • 我可以充分利用暂存区域/索引,例如仅暂存特定线路,
  • 我只需要在对它们感到满意时发布更改(即我尝试了一些东西并且它成功了或者我使历史变得连贯),
  • 我可以轻松通过补丁系列周围进行审查。

作为奖励,git 与 SVN 和 CVS 的接口允许我选择退出争论,如果我们应该将我们的 CVS 存储库切换到 subversion(持续了 3 年多),或者立即追求一些非常酷和奇特的东西(持续了 2 年多) 。

您实际上不需要管理人员决定开发人员应该使用什么。无论如何,中央存储库所使用的内容可能是由其他参数驱动的(例如构建、审查和测试基础设施)。

For me the major advantages of using git-svn (and the CVS bridge) are that

  • I have all the history locally for browsing and git-blame,
  • I have full version control when offline, e.g. on the train,
  • I can take full advantage of the staging area/index to e.g. only stage specific lines,
  • I only need to publish changes when I am happy with them (i.e. I experimented with something and it worked out or I have made the history coherent),
  • I can easily pass patch series around for review.

As a bonus, git's interfaces to SVN and CVS allowed me to opt-out the arguments if we should switch our CVS repository to subversion (ongoing since 3+ years) or go for something really cool and fancy immediately (ongoing since 2+ years).

You don't really need a management decision on what developers should use. What is used for your central repository might be driven by other arguments anyway (e.g. build, review and testing infrastructure).

冰魂雪魄 2024-11-09 16:24:15

对我来说,一切都与当地分支机构有关。当需要开始处理 BigNewFeature 时,我可以使用 git 创建一个新分支(本地)并开始处理它,按照我喜欢的方式提交每一步。然后,当有人不可避免地打断我在 BigNewFeature 上的工作并希望我修复 SmallTypo 时,我可以切换到 master 分支,修复拼写错误,然后将其推送到 svn。我可以返回 BigNewFeature 分支并继续处理我的业务。

这些廉价的本地分支为您作为开发人员提供了很大的灵活性,而当您必须处理 svn 分支和合并时,您就无法获得这些灵活性。我不害怕快速分支和实验。然后,当我对结果感到满意时,我可以将我喜欢的任何内容合并回 master 中,并以一组干净、易于识别的提交将其推送到 SVN。

For me it's all about the local branches. When it's time to start working on BigNewFeature, I can create a new branch (locally) using git and start working on it, committing each step of the way as I like. Then when someone inevitably interrupts me from working on BigNewFeature and wants me to fix SmallTypo, I can switch to the master branch, fix the typo, then push it to svn. I can go back to my BigNewFeature branch and go on about my business.

These cheap local branches give you a lot of flexibility as a developer that you just don't get when you have to deal with svn branching and merging. I'm not afraid to quickly branch and experiment. Then when I'm happy with the results I can merge whatever I like back into the master and push it to SVN in a set of clean, easy to discern commits.

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