简体   繁体   English

反对从svn切换到Git版本控制的任何理由?

[英]Any reason against switching from svn to Git Version Control?

I have been for a long time now, a happy svn user. 我已经很久了,一个快乐的svn用户。 Lately I find myself often disconnected from my repository so I'm considering a switch to Git. 最近我发现自己经常与我的存储库断开连接,因此我正在考虑切换到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? 我很想知道Git是否对小项目有点过分了? Are there many gotchas ahead? 还有很多陷阱吗? is there a very different workflow or a great learning-curve? 有一个非常不同的工作流程或一个伟大的学习曲线?

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]!" 如果你发现自己在想“哦,[这个git概念]就像[那个svn概念]!” be careful, because it may in fact be very different. 要小心,因为它实际上可能是非常不同的。 For example, svn revert means to throw away uncommitted changes. 例如, svn revert意味着丢弃未提交的更改。 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". git revert意味着创建一个新的提交,它撤消由一个或多个现有提交引入的更改,类似于svn“反向合并”。 The git command that is closest to svn revert is probably git checkout . 最接近svn revert的git命令可能是git 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. 此外,许多git命令作用于整个存储库,而对于svn背景,您可能希望它们仅在当前子目录上工作。

Is git better? git更好吗? IMHO, absolutely yes. 恕我直言,绝对是的。 But are there some gotchas? 但是有一些陷阱吗? Yes. 是。

I think the only reason not to switch from SVN to git is the time you'll need to learn the new system. 我认为不从SVN切换到git的唯一原因是你需要学习新系统的时间。 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. 恕我直言,熟悉是SVN唯一的目标。

Git works fine for small projects. Git适用于小型项目。

I have a small Lisp utilities library here: https://github.com/pnathan/batteries . 我这里有一个小的Lisp实用程序库: 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: 通常你可以在git中轻松完成你的svn工作流程:

workwork

commit -a -m "my message"

push

goto workwork

That won't use the full power of git, but it will get your needs satisfied. 这不会使用git的全部功能,但它会满足您的需求。

If you're already proficient with SVN and you often use it on your own, why not setup a local SVN repository? 如果您已经熟练使用SVN并且经常自己使用它,为什么不设置本地SVN存储库? DVCS really shines with groups of people contributing to the same project. DVCS真的很闪耀着为同一个项目做出贡献的人群。 If you're not running into any of the common Subversion problems in your normal development cycle why switch? 如果您没有在正常开发周期中遇到任何常见的Subversion问题,为什么要切换?

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. 话虽这么说,我现在更高兴我正在使用DVCS(Mercurial)并且甚至可能在单独的项目上使用它或Git。 We switched because of merge issues in SVN, so there was a legitimate problem which caused us to try a new system. 由于SVN中的合并问题我们切换了,所以有一个合法的问题导致我们尝试新的系统。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM