我正在开始一个新的分布式项目。我应该使用SVN还是Git,为什么?
当前回答
我会选择SVN,因为它传播更广泛,知名度更高。
我想Git更适合Linux用户。
其他回答
我会选择SVN,因为它传播更广泛,知名度更高。
我想Git更适合Linux用户。
重点是,Git是分布式VCS, Subversion是集中式VCS。分布式vcs比较难理解,但是有很多优点。如果不需要这些优点,Subversion可能是更好的选择。
另一个问题是工具支持。您计划使用的工具更好地支持哪种VCS ?
编辑:三年前我是这样回答的:
Git目前只能通过Cygwin或MSYS在Windows上运行。 Subversion从一开始就支持Windows。作为解决方案 对于Windows可能为你工作,可能会有问题,作为最 Git的开发人员在Linux上工作,没有可移植性 心灵从一开始。目前我更喜欢Subversion 在Windows下开发。几年后,这可能就无关紧要了。
现在世界发生了一点变化。Git现在在windows上有一个很好的实现。虽然我没有在windows上进行全面测试(因为我不再使用这个系统),但我很有信心,所有主要的VCS (SVN、Git、Mercurial、Bazaar)现在都有适当的windows实现。SVN的这一优势已经不复存在。其他要点(集中式vs.分布式以及工具支持的检查)仍然有效。
If your team is already familiar with version and source control softwares like cvs or svn, then, for a simple and small project (such as you claim it is), I would recommend you stick to SVN. I am really comfortable with svn, but for the current e-commerce project I am doing on django, I decided to work on git (I am using git in svn-mode, that is, with a centralised repo that I push to and pull from in order to collaborate with at least one other developer). The other developer is comfortable with SVN, and while others' experiences may differ, both of us are having a really bad time embracing git for this small project. (We are both hardcore Linux users, if it matters at all.)
当然,你的里程可能会有所不同。
我会设置一个Subversion存储库。通过这种方式,个人开发人员可以选择是使用Subversion客户机还是Git客户机(使用Git -svn)。使用Git -svn不能为您提供完整Git解决方案的所有好处,但它确实为单个开发人员提供了对自己的工作流的大量控制。
我相信Git在Windows上的表现会在相对较短的时间内达到在Unix和Mac OS X上的效果(既然你问了)。
Subversion为Windows提供了出色的工具,例如用于浏览器集成的TortoiseSVN和用于Visual Studio集成的AnkhSVN。
这是我在2009年9月删除Git vs. SVN的问题后,对一些重复问题的回答的副本。
更好吗?除了通常的WhyGitIsBetterThanX链接外,它们是不同的:
一个是基于分支和标记的廉价拷贝的中央VCS 另一个(Git)是基于修订图的分布式VCS。 参见VCS的核心概念。
第一部分产生了一些错误的评论,假装这两个程序(SVN和Git)的基本目的是相同的,但它们的实现却截然不同。 为了澄清SVN和Git之间的根本区别,让我重新表述一下:
SVN is the third implementation of a revision control: RCS, then CVS and finally SVN manage directories of versioned data. SVN offers VCS features (labeling and merging), but its tag is just a directory copy (like a branch, except you are not "supposed" to touch anything in a tag directory), and its merge is still complicated, currently based on meta-data added to remember what has already been merged. Git is a file content management (a tool made to merge files), evolved into a true Version Control System, based on a DAG (Directed Acyclic Graph) of commits, where branches are part of the history of datas (and not a data itself), and where tags are a true meta-data.
说他们没有“根本”不同,因为你可以实现同样的事情,解决同样的问题,是……在很多层面上都是错误的。
if you have many complex merges, doing them with SVN will be longer and more error prone. if you have to create many branches, you will need to manage them and merge them, again much more easily with Git than with SVN, especially if a high number of files are involved (the speed then becomes important) if you have partial merges for a work in progress, you will take advantage of the Git staging area (index) to commit only what you need, stash the rest, and move on on another branch. if you need offline development... well with Git you are always "online", with your own local repository, whatever the workflow you want to follow with other repositories.
然而,对那个旧答案(已删除)的评论坚持认为:
冯克:你混淆了执行上的根本差异(这种差异是非常根本的,我们显然都同意这一点)和目的上的差异。 它们都是用于相同目的的工具:这就是为什么许多以前使用SVN的团队能够相当成功地抛弃SVN,转而使用Git的原因。 如果他们不解决同一个问题,这种可替代性就不会存在。
,我回答说:
“可代换性”……有趣的术语(用于计算机编程)。 当然,Git并不是SVN的子类型。
您可以使用这两种工具实现相同的技术特性(标记、分支、合并),但是Git不会妨碍您,它允许您专注于文件的内容,而不用考虑工具本身。
你当然不能(总是)用Git替换SVN,“而不改变该程序的任何可取属性(正确性、执行的任务……)”。(引用了前面提到的可替代性定义):
One is an extended revision tool, the other a true version control system. One is suited small to medium monolithic project with simple merge workflow and (not too much) parallel versions. SVN is enough for that purpose, and you may not need all the Git features. The other allows for medium to large projects based on multiple components (one repo per component), with large number of files to merges between multiple branches in a complex merge workflow, parallel versions in branches, retrofit merges, and so on. You could do it with SVN, but you are much better off with Git. SVN simply can not manage any project of any size with any merge workflow. Git can.
同样,它们的本质是不同的(这会导致不同的实现,但这不是重点)。 一个将修订控制视为目录和文件,另一个仅看到文件的内容(以至于空目录甚至不会在Git中注册!)
一般的最终目标可能是相同的,但您不能以相同的方式使用它们,也不能解决相同类型的问题(在范围或复杂性方面)。
推荐文章
- 为什么我需要显式地推一个新分支?
- 如何撤消最后的git添加?
- Rubymine:如何让Git忽略Rubymine创建的.idea文件
- Gitignore二进制文件,没有扩展名
- Git隐藏错误:Git隐藏弹出并最终与合并冲突
- 了解Git和GitHub的基础知识
- 没有。Git目录的Git克隆
- Git与Mercurial仓库的互操作性
- 忽略git中修改(但未提交)的文件?
- “git restore”命令是什么?“git restore”和“git reset”之间有什么区别?
- Git合并与强制覆盖
- Git拉另一个分支
- 在Bash命令提示符上添加git分支
- 如何更改Git日志日期格式
- git pull -rebase和git pull -ff-only之间的区别