{"id":544,"date":"2013-10-14T02:57:26","date_gmt":"2013-10-14T06:57:26","guid":{"rendered":"http:\/\/blogs.law.harvard.edu\/acts\/?p=544"},"modified":"2013-10-20T22:24:44","modified_gmt":"2013-10-21T02:24:44","slug":"svn-vs-git","status":"publish","type":"post","link":"https:\/\/archive.blogs.harvard.edu\/acts\/2013\/10\/14\/svn-vs-git\/","title":{"rendered":"SVN vs Git"},"content":{"rendered":"<p>SVN is a minor improvement on the CVS design. A linear, central repository. To their credit, the developers of SVN acknowledge this, from the <a href=\"http:\/\/svnbook.red-bean.com\/en\/1.7\/svn-book.html\">Red Book<\/a>:<\/p>\n<blockquote><p>Subversion was designed to be a successor to CVS, and its originators set out to win the hearts of CVS users in two ways\u2014by creating an open source system with a design (and \u201clook and feel\u201d) similar to CVS, and by attempting to avoid most of CVS&#8217;s noticeable flaws. While the result wasn&#8217;t\u2014and isn&#8217;t\u2014the next great evolution in version control design, Subversion is very powerful, very usable, and very flexible.<\/p><\/blockquote>\n<p>Git is a Distributed Version Control System (DVCS). It&#8217;s important to distinguish it as &#8220;decentralized&#8221;. What that means is that each user creates a literal &#8220;<a href=\"http:\/\/en.wikipedia.org\/wiki\/Fork_(software_development)\">fork<\/a>&#8221; of the project.<\/p>\n<p>What Git offers that&#8217;s important is lightweight branching and significantly better merging. These are what make advanced workflows (feature branches) possible. See <a href=\"http:\/\/nvie.com\/posts\/a-successful-git-branching-model\/\">Git Flow<\/a>.<\/p>\n<p><del datetime=\"2013-10-21T02:02:31+00:00\">Branching by itself isn&#8217;t where the magic is. What makes Git bounds above SVN is actually the merging. What makes the merging so much better is actually how the history of commits is kept. Git is a Directed Acyclic Graph (DAG) and SVN is done linearly.<\/del><\/p>\n<p><del datetime=\"2013-10-21T02:04:06+00:00\">What this means is the SVN merge doesn&#8217;t take into account previous merges of the branch, it merges the files directly. They&#8217;re both doing <a href=\"http:\/\/en.wikipedia.org\/wiki\/Merge_(revision_control)#Three-way_merge\">3-way merges<\/a>, but the 3rd that is used (the common ancestor) isn&#8217;t the same because the linear history of SVN isn&#8217;t taking into account previous merges. So basically SVN goes back way further because it doesn&#8217;t know where the last merge between branches was. The result is a lot more conflicts that have to be manually resolved.<\/del><\/p>\n<p><ins datetime=\"2013-10-21T02:21:51+00:00\">The above is outdated. As of SVN version 1.5, (2008), SVN includes meta data on merge histories, so it uses the 3-way merge to similar effect as Git now. I&#8217;m going to have to write a new one of these after more research.<\/ins><\/p>\n<p>https:\/\/git.wiki.kernel.org\/index.php\/GitSvnComparsion<br \/>\nhttp:\/\/stackoverflow.com\/questions\/871\/why-is-git-better-than-subversion\/873#873<br \/>\nhttp:\/\/blog.evanweaver.com\/2007\/08\/15\/svn-branching-best-practices-in-practice\/<br \/>\nhttp:\/\/stackoverflow.com\/questions\/2471606\/how-and-or-why-is-merging-in-git-better-than-in-svn<\/p>\n","protected":false},"excerpt":{"rendered":"<p>SVN is a minor improvement on the CVS design. A linear, central repository. To their credit, the developers of SVN acknowledge this, from the Red Book: Subversion was designed to be a successor to CVS, and its originators set out to win the hearts of CVS users in two ways\u2014by creating an open source system [&hellip;]<\/p>\n","protected":false},"author":4571,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3772,17296,1,63993],"tags":[63995,64004,111237],"class_list":["post-544","post","type-post","status-publish","format-standard","hentry","category-git","category-svn","category-uncategorized","category-version-control","tag-git-2","tag-svn-2","tag-version-control-2"],"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/archive.blogs.harvard.edu\/acts\/wp-json\/wp\/v2\/posts\/544","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/archive.blogs.harvard.edu\/acts\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/archive.blogs.harvard.edu\/acts\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/archive.blogs.harvard.edu\/acts\/wp-json\/wp\/v2\/users\/4571"}],"replies":[{"embeddable":true,"href":"https:\/\/archive.blogs.harvard.edu\/acts\/wp-json\/wp\/v2\/comments?post=544"}],"version-history":[{"count":7,"href":"https:\/\/archive.blogs.harvard.edu\/acts\/wp-json\/wp\/v2\/posts\/544\/revisions"}],"predecessor-version":[{"id":568,"href":"https:\/\/archive.blogs.harvard.edu\/acts\/wp-json\/wp\/v2\/posts\/544\/revisions\/568"}],"wp:attachment":[{"href":"https:\/\/archive.blogs.harvard.edu\/acts\/wp-json\/wp\/v2\/media?parent=544"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/archive.blogs.harvard.edu\/acts\/wp-json\/wp\/v2\/categories?post=544"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/archive.blogs.harvard.edu\/acts\/wp-json\/wp\/v2\/tags?post=544"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}