与其他 SVN 客户端相比,使用 GIT-SVN 有何缺点?
我想开始使用 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
好处
这就是我发现它有价值的原因,尽管可能还有其他原因。
git-svn rebase
比 SVN 内置的冲突解决工具好一千倍。缺点
主要的严重缺点:确保不要执行任何
合并
操作,否则当您尝试提交时 SVN 会崩溃。另外,因为您使用rebase
与 SVN 存储库同步,并且从已重新设置基准的存储库中提取会导致 Git 崩溃,所以这要困难得多维护主 Git 存储库的克隆(您最终可能需要删除它们并在每次变基后重新克隆。)Benefits
Here's why I found it valuable, although there may be other reasons for it.
git-svn rebase
is a thousand times better than SVN's built-in conflict-resolution tools.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 usingrebase
to sync with the SVN repository, and sincepull
ing 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.)我能想到的主要缺点是初始克隆可能非常慢,因为您正在克隆项目的整个历史记录。当然,纯 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.我同意 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.
我还想到了一些:
svn:mergeinfo
属性将不会被设置。事实上,我认为几乎任何使用 SVN 属性的事情,你都不能通过 git-svn 来完成。总的来说,恕我直言,它仍然比使用标准 SVN 客户端好得多,但也有一些明显的缺点。
A couple more I thought of:
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.