与其他 SVN 客户端相比,使用 GIT-SVN 有何缺点?

发布于 2024-11-25 16:16:09 字数 198 浏览 1 评论 0原文

我想开始使用 GIT-SVN 来处理 SVN 存储库。我知道使用 GIT 的很多好处仍然存在于 GIT-SVN 中,例如轻量级分支,以及 改进了文件重命名/移动检测

但我想知道是否有任何我应该注意的缺点?

I would like to start using GIT-SVN to work with an SVN repository. I know that a lot of the benefits of using GIT are still present with GIT-SVN like lightweight branching, and improved file rename/move detection.

But I was wondering if there are any drawbacks that I should be aware of?

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

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

发布评论

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

评论(4

给不了的爱 2024-12-02 16:16:09

好处

这就是我发现它有价值的原因,尽管可能还有其他原因。

  • 无需对项目进行提交访问即可开始编码。
  • 可以在本地计算机上进行版本控制,无需提交访问权限,甚至无需互联网连接。
  • 更容易浏览整个修订历史记录(包括 SVN 历史记录)。
  • git-svn rebase 比 SVN 内置的冲突解决工具好一千倍。
  • 您仍然可以从 Git 改进的分支机制中获得一些有限的好处。

缺点

主要的严重缺点:确保不要执行任何合并操作,否则当您尝试提交时 SVN 会崩溃。另外,因为您使用 rebase 与 SVN 存储库同步,并且从已重新设置基准的存储库中提取会导致 Git 崩溃,所以这要困难得多维护主 Git 存储库的克隆(您最终可能需要删除它们并在每次变基后重新克隆。)

Benefits

Here's why I found it valuable, although there may be other reasons for it.

  • No need for commit access on a project in order to get started coding.
  • Can do revision control on local machines without commit access or even an Internet connection.
  • Easier to browse entire revision history (including the SVN history.)
  • git-svn rebase is a thousand times better than SVN's built-in conflict-resolution tools.
  • You still get some limited benefit from Git's improved branching mechanics.

Drawback

The major crippling drawback: be sure not to do any merge operations or else SVN will freak out when you try to commit. Also, because you're using rebase to sync with the SVN repository, and since pulling from a repository that's been rebased will cause Git to freak out, it's much more difficult to maintain clones of the main Git repository (you may end up needing to delete them and re-clone after each rebase.)

宛菡 2024-12-02 16:16:09

我能想到的主要缺点是初始克隆可能非常慢,因为您正在克隆项目的整个历史记录。当然,纯 git 也是如此,但如果您从纯 git 服务器克隆,它就是为此设计的。 svn 存储库不是,因此 git-svn 必须一次获取一个修订版本的历史记录。一种解决方案(除了让克隆操作过夜运行之外)是执行“浅克隆”,但显然你没有完整的历史记录,所以你必须使用 svn log 来查找非常旧的修订。

The main drawback I can think of is that the initial clone can be very slow, since you're cloning the entire history of the project. This is true with pure git too, of course, but if you're cloning from a pure git server, it's designed for that. The svn repository is not, so git-svn has to get the history one revision at a time. One solution (other than just letting the clone operation run overnight) is to do a "shallow clone" though then you obviously don't have the entire history, so you have to use svn log to look for very old revisions.

愚人国度 2024-12-02 16:16:09

我同意 MatrixFrog 的观点,即速度是一个问题。尤其是当您第一次克隆项目时确实如此,但不仅仅是那时。

我遇到的另一个问题是 git-svn 本身几乎不支持 svn:externals。而且我能找到的最佳解决方案并不总是按其应有的方式工作。

I agree with MatrixFrog that speed is a problem. That's true especially when you clone a project for the first time, but not just then.

Another problem I encountered is that there is almost no support for svn:externals in git-svn itself. And the best solution I could find doesn't always work the way it should.

画离情绘悲伤 2024-12-02 16:16:09

我还想到了一些:

  • 在移动/重命名文件时,git 不会存储任何表示“此文件已重命名”的元数据,它只是通过注意到旧文件和新文件非常相似来找出这一点。 SVN 希望您通过 SVN 进行重命名,以便它可以记录一些元数据。 Git 不会这样做,因此您的 SVN 存储库不会拥有应有的所有历史记录。
  • 合并时(或更可能的是,根据 Max 的说法进行挑选),svn:mergeinfo 属性将不会被设置。事实上,我认为几乎任何使用 SVN 属性的事情,你都不能通过 git-svn 来完成。

总的来说,恕我直言,它仍然比使用标准 SVN 客户端好得多,但也有一些明显的缺点。

A couple more I thought of:

  • When moving/renaming a file, git doesn't store any metadata that says, "this file was renamed", it just figures it out by noticing that the old file and the new file are very similar. SVN expects you to do the rename through SVN so that it can record some metadata. Git won't do this, so your SVN repo won't have all the history it's supposed to have.
  • When merging (or more likely, cherry-picking because of what Max said), the svn:mergeinfo properties won't get set. In fact, I think pretty much anything that uses SVN properties, you can't do though git-svn.

Overall, it's still much nicer than using a standard SVN client IMHO, but there are some definite drawbacks.

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