{"id":71,"date":"2008-10-25T21:50:45","date_gmt":"2008-10-26T02:50:45","guid":{"rendered":"http:\/\/bda.ath.cx\/blog\/?p=71"},"modified":"2010-06-26T22:33:38","modified_gmt":"2010-06-27T03:33:38","slug":"converting-subversion-repositories-to-git","status":"publish","type":"post","link":"http:\/\/bda.ath.cx\/blog\/2008\/10\/25\/converting-subversion-repositories-to-git\/","title":{"rendered":"Converting subversion repositories to git"},"content":{"rendered":"<p>See <a href=\"http:\/\/pauldowman.com\/2008\/07\/26\/how-to-convert-from-subversion-to-git\/\">How to convert from subversion to git<\/a> by Paul Dowman.<\/p>\n<p>When you use git-svn to clone a subversion repository to git, it converts svn tags to git remote branches. This behavior makes sense if you will continue to use the svn repository. However for permanent conversion I prefer converting them to git tags. The above link is the only howto I found which includes this step.<\/p>\n<p>Here&#8217;s a script which echos the required commands to migrate the branches to tags:<\/p>\n<pre><code>for tag in $(git branch -r | grep tags | grep -v @) ; do\r\n  t=${tag\/tags\\\/\/};\r\n  echo git tag $t tags\/$t^;\r\n  echo git branch -r -d tags\/$t;\r\ndone<\/code><\/pre>\n<p>To remove the final traces of git-svn:<\/p>\n<pre><code>git config --remove-section svn-remote.svn\r\nrm -rf .git\/svn\r\ngit branch -r -d trunk\r\n<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>See How to convert from subversion to git by Paul Dowman. When you use git-svn to clone a subversion repository to git, it converts svn tags to git remote branches. This behavior makes sense if you will continue to use the svn repository. However for permanent conversion I prefer converting them to git tags. The [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[83],"class_list":["post-71","post","type-post","status-publish","format-standard","hentry","category-programming","tag-source-control"],"_links":{"self":[{"href":"http:\/\/bda.ath.cx\/blog\/wp-json\/wp\/v2\/posts\/71","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/bda.ath.cx\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/bda.ath.cx\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/bda.ath.cx\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/bda.ath.cx\/blog\/wp-json\/wp\/v2\/comments?post=71"}],"version-history":[{"count":3,"href":"http:\/\/bda.ath.cx\/blog\/wp-json\/wp\/v2\/posts\/71\/revisions"}],"predecessor-version":[{"id":175,"href":"http:\/\/bda.ath.cx\/blog\/wp-json\/wp\/v2\/posts\/71\/revisions\/175"}],"wp:attachment":[{"href":"http:\/\/bda.ath.cx\/blog\/wp-json\/wp\/v2\/media?parent=71"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/bda.ath.cx\/blog\/wp-json\/wp\/v2\/categories?post=71"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/bda.ath.cx\/blog\/wp-json\/wp\/v2\/tags?post=71"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}