{"id":274,"date":"2012-08-15T23:03:28","date_gmt":"2012-08-16T03:03:28","guid":{"rendered":"http:\/\/blogs.law.harvard.edu\/acts\/?p=274"},"modified":"2012-08-15T23:03:28","modified_gmt":"2012-08-16T03:03:28","slug":"using-git-with-svn","status":"publish","type":"post","link":"https:\/\/archive.blogs.harvard.edu\/acts\/2012\/08\/15\/using-git-with-svn\/","title":{"rendered":"Using git with svn"},"content":{"rendered":"<p>If you have the choice, don&#8217;t. Pick one and stick with it. My personal preference at this time is git because it facilitates smaller commits &#8212; but who cares what I prefer, you&#8217;re probably tied to a versioning system based on what someone long before you decided to use.<\/p>\n<p>I for one am tied to svn for doing deploys, but since I&#8217;m gaga over git and doing things in the open, I want to use git on a day to day basis and just use svn for deploys.  <\/p>\n<p>This sucks, but if you&#8217;re going to do it, you shouldn&#8217;t be a douche and add your .git directory to svn.  That was my first attempt, even though I knew it was bad, I wanted to see the performance hit on svn firsthand I guess.<\/p>\n<p>So I have the deployment related files in svn, so git is free of any environment specific files, like database configs.<\/p>\n<p>So I do all development in git with &#8220;.svn&#8221; in the .gitignore.  That part is easy.  Getting svn to ignore git is <a href=\"http:\/\/blogs.law.harvard.edu\/acts\/2012\/08\/08\/svn-ignoring-git\/\" title=\"SVN ignoring Git\">a little more annoying<\/a>, especially if you have multiple submodules.  So when you&#8217;re ready, you add everything to svn, then rm the .git files.  It&#8217;s better <a href=\"http:\/\/stackoverflow.com\/questions\/542065\/svn-remove-file-from-repository-without-deleting-local-copy\">to rm them with the &#8211;keep-local flag<\/a>.<\/p>\n<p>If you delete the .git files because you forgot to &#8211;keep-local, or, more likely you&#8217;ve had to blow away your development and bring it back via svn, then you have to restore the .git files.  <a href=\"http:\/\/stackoverflow.com\/questions\/6246907\/can-deleted-git-be-restored\">Restoring them isn&#8217;t so bad<\/a>:<br \/>\n<code><br \/>\ngit init<br \/>\ngit remote add origin git@github.com\/your_project.git<br \/>\ngit pull origin master<br \/>\n<\/code><\/p>\n","protected":false},"excerpt":{"rendered":"<p>If you have the choice, don&#8217;t. Pick one and stick with it. My personal preference at this time is git because it facilitates smaller commits &#8212; but who cares what I prefer, you&#8217;re probably tied to a versioning system based on what someone long before you decided to use. I for one am tied to [&hellip;]<\/p>\n","protected":false},"author":4571,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[63924,3772,17296,63993],"tags":[63995,64004],"class_list":["post-274","post","type-post","status-publish","format-standard","hentry","category-atg","category-git","category-svn","category-version-control","tag-git-2","tag-svn-2"],"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/archive.blogs.harvard.edu\/acts\/wp-json\/wp\/v2\/posts\/274","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=274"}],"version-history":[{"count":1,"href":"https:\/\/archive.blogs.harvard.edu\/acts\/wp-json\/wp\/v2\/posts\/274\/revisions"}],"predecessor-version":[{"id":275,"href":"https:\/\/archive.blogs.harvard.edu\/acts\/wp-json\/wp\/v2\/posts\/274\/revisions\/275"}],"wp:attachment":[{"href":"https:\/\/archive.blogs.harvard.edu\/acts\/wp-json\/wp\/v2\/media?parent=274"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/archive.blogs.harvard.edu\/acts\/wp-json\/wp\/v2\/categories?post=274"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/archive.blogs.harvard.edu\/acts\/wp-json\/wp\/v2\/tags?post=274"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}