有什么理由反对从 svn 切换到 Git 版本控制吗?
我已经很长时间了,一个快乐的 svn 用户。最近,我发现自己经常与存储库断开连接,因此我正在考虑切换到 Git。
鉴于大多数项目都是我独自完成的。我很想知道 Git 对于小型项目是否太过杀伤力?前面还有很多陷阱吗?是否有非常不同的工作流程或出色的学习曲线?
I have been for a long time now, a happy svn user. Lately I find myself often disconnected from my repository so I'm considering a switch to Git.
Given the fact that I work alone on most of these projects. I'm interested to know if Git is overkill for small projects? Are there many gotchas ahead? is there a very different workflow or a great learning-curve?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
我绝对建议进行转换,但请注意,这需要一些工作。如果您发现自己在想“哦,[这个 git 概念] 就像 [那个 svn 概念]!”要小心,因为实际上可能非常不同。例如,
svn revert
表示丢弃未提交的更改。git revert
意味着创建一个新的提交,撤消由一个或多个现有提交引入的更改,有点像 svn“反向合并”。与 svn revert 最接近的 git 命令可能是 git checkout。此外,许多 git 命令作用于整个存储库,而在 svn 背景下,您可能希望它们仅作用于当前子目录。吉特更好吗?恕我直言,绝对是的。但有一些陷阱吗?是的。
I definitely recommend making the switch, but note that it will take some work. If you find yourself thinking "Oh, [this git concept] is just like [that svn concept]!" be careful, because it may in fact be very different. For example,
svn revert
means to throw away uncommitted changes.git revert
means to create a new commit that undoes the changes that were introduced by one or more existing commits, kind of like an svn "reverse-merge". The git command that is closest tosvn revert
is probablygit checkout
. Also, many git commands act on the entire repository, whereas with an svn background, you might expect them to only work on the current subdirectory.Is git better? IMHO, absolutely yes. But are there some gotchas? Yes.
我认为不从 SVN 切换到 git 的唯一原因是你需要学习新系统的时间。当然,如果这是一个非常有力的理由,我们仍然会使用打孔卡。恕我直言,熟悉是 SVN 唯一的优势。
I think the only reason not to switch from SVN to git is the time you'll need to learn the new system. Of course, if that were a very strong reason, we'd all still be using punch cards. IMHO, familiarity is the only thing SVN has going for it.
Git 对于小型项目来说效果很好。
我这里有一个小型 Lisp 实用程序库:https://github.com/pnathan/batteries。如您所知,它很小。
您会发现工作流程更加灵活,特别是在分支领域。学习曲线曾经是出了名的差,但是有很多教程。
通常,您可以在 git 中真正轻松地完成 svn 工作流程:
这不会使用 git 的全部功能,但它会满足您的需求。
Git works fine for small projects.
I have a small Lisp utilities library here: https://github.com/pnathan/batteries. As you can tell, it is tiny.
You will find the workflow to be much more flexible, particular in the area of branching. The learning curve used to be notoriously poor, but there's a good deal of tutorials out there.
Typically you can do your svn workflow real easy in git:
That won't use the full power of git, but it will get your needs satisfied.
如果您已经精通 SVN 并且经常自己使用它,为什么不设置一个本地 SVN 存储库呢? DVCS 确实因一群人为同一项目做出贡献而大放异彩。如果您在正常的开发周期中没有遇到任何常见的 Subversion 问题,为什么要进行切换?
话虽这么说,我现在更高兴我正在使用 DVCS (Mercurial),并且甚至可能在单独的项目中使用它或 Git。由于 SVN 中的合并问题,我们进行了切换,因此存在合法问题,导致我们尝试新系统。
If you're already proficient with SVN and you often use it on your own, why not setup a local SVN repository? DVCS really shines with groups of people contributing to the same project. If you're not running into any of the common Subversion problems in your normal development cycle why switch?
That being said, I am much happier now that I'm using a DVCS (Mercurial) and would likely use it or Git even on solo projects. We switched because of merge issues in SVN, so there was a legitimate problem which caused us to try a new system.