{"id":12150,"date":"2018-04-03T11:33:05","date_gmt":"2018-04-03T16:33:05","guid":{"rendered":"http:\/\/jianmingli.com\/wp\/?p=12150"},"modified":"2018-04-03T11:33:05","modified_gmt":"2018-04-03T16:33:05","slug":"git-example-migrate-files-from-svn-to-git","status":"publish","type":"post","link":"https:\/\/jianmingli.com\/wp\/?p=12150","title":{"rendered":"Git Example: Migrate Files from SVN to Git"},"content":{"rendered":"<pre lang=\"bash\">\r\n# Export project from SVN into a local directory, e.g. \/c\/stage\/svn\r\n\r\n# Create a new git repo, e.g. myproj.git\r\ncd \/c\/vc\r\ngit init --bare myproj.git\r\n\r\n# Now clone the newly created repo in a work directory, e.g. \/c\/work\r\ncd \/c\/work\r\ngit clone file:\/\/\/c\/vc\/myproj.git\r\n\r\n# Move files exported from svn to the git work directory\r\ncd \/c\/work\/myproj\r\nmv \/c\/stage\/svn\/trunk\/myproj\/* .\r\n\r\n# Add and commit svn files to git repo\r\ngit add -A\r\ngit commit -m \"Initial from svn.\"\r\n\r\n# Push changes\r\ngit push origin master\r\n\r\n# Export a git repo\r\ngit archive --format zip --output \/c\/stage\/git-proj.zip master\r\n\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p># Export project from SVN into a local directory, e.g. \/c\/stage\/svn # Create a new git repo, e.g. myproj.git cd \/c\/vc git init &#8211;bare myproj.git # Now clone the newly created repo in a work directory, e.g. \/c\/work cd \/c\/work &hellip; <a href=\"https:\/\/jianmingli.com\/wp\/?p=12150\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_exactmetrics_skip_tracking":false,"_exactmetrics_sitenote_active":false,"_exactmetrics_sitenote_note":"","_exactmetrics_sitenote_category":0,"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[236,67],"tags":[616,581],"class_list":["post-12150","post","type-post","status-publish","format-standard","hentry","category-git","category-svn","tag-git","tag-svn"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p8cRUO-39Y","_links":{"self":[{"href":"https:\/\/jianmingli.com\/wp\/index.php?rest_route=\/wp\/v2\/posts\/12150","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/jianmingli.com\/wp\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/jianmingli.com\/wp\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/jianmingli.com\/wp\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/jianmingli.com\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=12150"}],"version-history":[{"count":1,"href":"https:\/\/jianmingli.com\/wp\/index.php?rest_route=\/wp\/v2\/posts\/12150\/revisions"}],"predecessor-version":[{"id":12151,"href":"https:\/\/jianmingli.com\/wp\/index.php?rest_route=\/wp\/v2\/posts\/12150\/revisions\/12151"}],"wp:attachment":[{"href":"https:\/\/jianmingli.com\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=12150"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/jianmingli.com\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=12150"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/jianmingli.com\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=12150"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}