{"id":545,"date":"2018-07-16T09:56:33","date_gmt":"2018-07-16T01:56:33","guid":{"rendered":"http:\/\/prayerlaputa.com\/?p=545"},"modified":"2019-07-16T10:55:06","modified_gmt":"2019-07-16T02:55:06","slug":"%e5%b0%86%e4%bb%a3%e7%a0%81%e4%bb%8esvn%e8%bf%81%e7%a7%bb%e5%88%b0git","status":"publish","type":"post","link":"http:\/\/prayerlaputa.com\/?p=545","title":{"rendered":"\u5c06\u4ee3\u7801\u4ecesvn\u8fc1\u79fb\u5230git"},"content":{"rendered":"\n<h1>\u9700\u6c42<\/h1>\n\n<p>\u5de5\u4f5c\u91cc\u6253\u7b97\u5c06\u4ee3\u7801\u4ecesvn\u8fc1\u79fb\u5230git\uff0c\u4f46svn\u6bd5\u7adf\u7528\u4e86\u4e00\u6bb5\u65f6\u95f4\uff0c\u63d0\u4ea4\u8bb0\u5f55\u3001tag\u3001release\u7b49\u4fe1\u606f\u5e0c\u671b\u8fd8\u80fd\u7ee7\u7eed\u4fdd\u7559\u3002<\/p>\n\n<h1>\u65b9\u6848<\/h1>\n\n<p>git\u5b98\u65b9\u672c\u8eab\u5c31\u7ed9\u4e86\u4e00\u4e2a\u6559\u7a0b\uff0c\u53c2\u89c1\uff1a\n<a href=\"https:\/\/git-scm.com\/book\/zh\/v1\/Git-%E4%B8%8E%E5%85%B6%E4%BB%96%E7%B3%BB%E7%BB%9F-%E8%BF%81%E7%A7%BB%E5%88%B0-Git\">Git\u4e0e\u5176\u4ed6\u7cfb\u7edf-\u8fc1\u79fb\u5230Git<\/a><\/p>\n\n<p>\u6559\u7a0b\u672c\u8eab\u5c31\u4ea4\u4ee3\u4e86\u524d\u56e0\u540e\u679c\uff0c\u6211\u5c31\u4e0d\u518d\u8d58\u8ff0\uff0c\u57fa\u672c\u6309\u7167\u6d41\u7a0b\u8d70\u5c31\u53ef\u4ee5\uff0c\u6211\u8fd9\u91cc\u53ea\u662f\u8bf4\u4e0b\u6211\u7684\u6b65\u9aa4\u4ee5\u53ca\u9047\u5230\u7684\u5751\u3002<\/p>\n\n<h3>\u51c6\u5907users.txt\u6587\u4ef6<\/h3>\n<!--more-->\n<p>\u6211\u76f4\u63a5\u624b\u5199\u7684\uff0c\u6bd5\u7adf\u63d0\u4ea4\u4eba\u4e0d\u7b97\u591a\uff0c\u4e5f\u53ef\u4ee5\u6267\u884c\u5b98\u65b9\u63d0\u4f9b\u7684\u547d\u4ee4\uff1a\n<code>\nsvn log ^\/ --xml | grep -P \"^&lt;author\" | sort -u | perl -pe 's\/&lt;author&gt;(.*?)&lt;\\\/author&gt;\/$1 = \/' &gt; users.txt\n<\/code>   <\/p>\n\n<h3>\u51c6\u5907\u597dusers.txt\u4e4b\u540e\uff0c\u6267\u884cgit svn clone\u547d\u4ee4<\/h3>\n\n<p>\u8f93\u5165git svn clone\u547d\u4ee4\u540e\uff0c\u5728windows\u4e0a\u540e\u4f9d\u6b21\u5f39\u51fa3\u4e2a\u8f93\u5165\u6846\uff0c\u4f9d\u6b21\u8f93\u5165\uff1a\n&#8211; windows\u7528\u6237\u9a8c\u8bc1\u6846\uff1a\u8f93\u5165windows\u767b\u5f55\u5bc6\u7801<br>&#8211; svn\u7528\u6237\u540d<br>&#8211; svn\u5bc6\u7801  <\/p>\n\n<p>\u8f93\u5165\u540e\u7b49\u5f85\u5373\u53ef\u3002<\/p>\n\n<p>\u6211\u6267\u884c\u7684\u547d\u4ee4\u5982\u4e0b\uff1a\ngit svn clone svn:\/\/xxx.xxx.xxx.xxx\/yyy\/ &#8211;no-metadata &#8211;authors-file=users.txt &#8211;no-minimize-url  -s xxx\ngit\u7f51\u9875\u4e0a\u7ed9\u7684\u547d\u4ee4\uff0c\u6709\u63d0\u5230<code>--no-metadata<\/code>\u662f\u53bb\u6389svn\u7684\u5143\u6570\u636e\uff0c\u4f46\u5982\u679c\u4e0d\u52a0\u5165<code>--no-minimize-url<\/code>\u547d\u4ee4\uff0cgit svn clone\u8fd9\u6761\u547d\u4ee4\u53ef\u80fd\u4f1a\u53bb\u626b\u63cf\u66f4\u4e0a\u5c42\u7684svn\u76ee\u5f55\u3002\u4f1a\u6709\u7c7b\u4f3c\u8fd9\u6837\u7684\u63d0\u793a\u4fe1\u606f\uff1a\n<code>\nInitialized empty Git repository in \/Users\/doc\/Test\/Demo\/.git\/ Using higher level of URL: https:\/\/xxxxxxx\/branch\/android\/project1 =&gt; https:\/\/xxxxxxxx\/branch\/android W: Ignoring error from SVN, path probably does not exist: (160013): Filesystem has no item: '\/xxxxxxbranch\/android' path not found W: Do not be alarmed at the above message git-svn is just searching aggressively for old history. This may take a while on large repositories ^Cecked through r290000\n<\/code>  <\/p>\n\n<p>\u6211\u8bb0\u5f97\u5982\u679c\u4f60\u6ca1\u6743\u9650\u7684\u8bdd\u4f1a\u62a5\u9519\u3002\u4fdd\u9669\u8d77\u89c1\uff0c\u8fd8\u662f\u5728\u547d\u4ee4\u884c\u52a0\u5165&#8211;no-minimize-url\u53c2\u6570\u5427\uff0c\u4e3b\u8981\u662f\u4e0d\u7f29\u5c0f\u8f93\u5165\u7684\u5730\u5740\u3002<\/p>\n\n<h3>\u62a5\u9519\uff1aAuthor: xx not defined in users.txt file<\/h3>\n\n<p>\u5982\u679c\u4f60\u8f93\u5165\u7684authors.txt\u4e2d\u7528\u6237\u6620\u5c04\u6ca1\u5217\u5168\u3001svn\u7684\u7528\u6237\u6709\u9057\u6f0f\uff0c\u53ef\u80fd\u6709\u5982\u4e0b\u62a5\u9519\uff1a\n<code>  \nAuthor: xx not defined in users.txt file  \n<\/code><br> \u6b64\u65f6\u8bb0\u5f97\u4fee\u6539authors.txt\u6587\u4ef6\uff0c\u5220\u9664\u6574\u4e2a\u6587\u4ef6\u5939\uff0c\u91cd\u65b0\u6267\u884cgit svn clone\u547d\u4ee4\u3002<\/p>\n\n<h4>\u6ce8\u610f<\/h4>\n\n<ul><li>\u8bf7\u5728\u4e00\u4e2a\u7a7a\u767d\u7684\u3001\u6ca1\u6709\u4e0egit\u6216\u662fsvn\u5173\u8054\u7684\u6587\u4ef6\u5939\uff08\u6700\u597d\u5c31\u662f\u65b0\u5efa\u4e00\u4e2a\u6587\u4ef6\u5939\uff09\u4e2d\u6267\u884cgit svn clone\u8fd9\u6761\u547d\u4ee4\uff0c\u5426\u5219\u64cd\u4f5c\u7ed3\u679c\u53ef\u80fd\u6bd4\u8f83\u602a\uff0c\u6211\u4e00\u5f00\u59cb\u6ca1\u7559\u610f\uff0c\u5728\u4e00\u4e2agit\u5e93\u4e2d\u6267\u884c\u8fd9\u547d\u4ee4\uff0c\u7ed3\u679c\u6709\u70b9\u5947\u602a\uff0c\u5c31\u4e0d\u591a\u63d0\u4e86\u3002  <\/li><li>\u8fd9\u6761\u547d\u4ee4\u7684\u6267\u884c\u65f6\u95f4\u4f9d\u8d56\u4e8e\u4f60\u7684svn\u7248\u672c\u5e93\u5185\u5bb9\u7684\u591a\u5be1\uff0c\u6bd4\u5982\u6211\u8fc1\u79fb\u7684svn\u5927\u6982\u7528\u4e86\u534a\u5e74\u591a\u5427\uff0c\u63d0\u4ea4\u8bb0\u5f55\u3001tag\u6bd4\u8f83\u591a\uff0c\u7ed3\u679c\u6267\u884cgit svn clone\u8fd9\u6761\u547d\u4ee4\u5927\u6982\u6267\u884c\u4e863\u4e2a\u591a\u5c0f\u65f6\u2026\u2026\u6267\u884c\u8be5\u547d\u4ee4\u65f6\u786e\u4fdd\u7f51\u7edc\u72b6\u51b5\u826f\u597d\uff0c\u7136\u540e\u4f60\u5c31\u53ef\u4ee5\u53bb\u505a\u522b\u7684\u4e8b\u60c5\u4e86<\/li><\/ul>\n\n<p>git svn clone\u6267\u884c\u7ed3\u675f\u3001\u6ca1\u62a5\u4efb\u4f55\u9519\u8bef\u7684\u8bdd\uff0c\u4f60\u4f1a\u5728\u4f60\u6307\u5b9a\u7684\u6587\u4ef6\u5939\u5185\u770b\u5230\u4f60\u60f3\u8fc1\u79fb\u7684svn\u4ee3\u7801\u3002\u63a5\u4e0b\u6765\uff0c\u6309\u7167git\u7ed9\u7684\u8bf4\u660e\uff0c\u7ee7\u7eed\u6267\u884c\u540e\u7eed\u547d\u4ee4\uff0c\u57fa\u672c\u5c31\u6ca1\u5565\u5751\u4e86\uff0c\u6c47\u603b\u547d\u4ee4\u5217\u8868\u89c1\u4e0b\u9762<code>\u6c47\u603b<\/code>\u3002<\/p>\n\n<h1>\u6c47\u603b<\/h1>\n\n<ol><li>\u51c6\u5907users.txt\u6587\u4ef6  <\/li><li>\u51c6\u5907\u597dusers.txt\u4e4b\u540e\uff0c\u6267\u884cgit svn clone\u547d\u4ee4  <\/li><li>git for-each-ref refs\/remotes\/tags | cut -d \/ -f 4- | grep -v @ | while read tagname; do git tag &#8220;$tagname&#8221; &#8220;tags\/$tagname&#8221;; git branch -r -d &#8220;tags\/$tagname&#8221;; done  <\/li><li>git for-each-ref refs\/remotes | cut -d \/ -f 3- | grep -v @ | while read branchname; do git branch &#8220;$branchname&#8221; &#8220;refs\/remotes\/$branchname&#8221;; git branch -r -d &#8220;$branchname&#8221;; done <\/li><li>git remote add origin xxxx   \u8fd9\u91cc\u9700\u8981\u5199\u4e0a\u4f60\u81ea\u5df1\u7684git\u8fdc\u7aef\u5730\u5740\uff0c\u6bd4\u5982gitlab\u4e0a\u4f60\u521b\u5efa\u7684\u9879\u76ee\u5730\u5740<\/li><li>git push origin &#8211;all<\/li><li>git push origin &#8211;tags<\/li><\/ol>\n\n<p>\u57fa\u672c\u6d41\u7a0b\u5c31\u8fd9\u6837\uff0c\u8fd8\u662f\u6bd4\u8f83\u7b80\u5355\u7684<\/p>\n\n<h1>\u53c2\u8003\u5e16\u5b50<\/h1>\n\n<ul><li><a href=\"https:\/\/blog.csdn.net\/xueshanhaizi\/article\/details\/54929365\">SVN\u8fc1\u79fb\u5230git<\/a>  \u8fd9\u7bc7\u6587\u7ae0\u5f88\u6709\u7528  <\/li><li><a href=\"https:\/\/www.lovelucy.info\/codebase-from-svn-to-git-migration-keep-commit-history.html\">\u5c06\u4ee3\u7801\u5e93\u4ece SVN \u8fc1\u79fb\u81f3 Git \u5e76\u4fdd\u7559\u6240\u6709 commit \u8bb0\u5f55<\/a>  <\/li><li><a href=\"https:\/\/blog.csdn.net\/u010648555\/article\/details\/52831194\">SVN\u2014\u2014SVN\u9879\u76ee\u8fc1\u79fb\u5230GIT<\/a>  <\/li><li><a href=\"https:\/\/blog.csdn.net\/cctt_1\/article\/details\/41317419\">\u5751\u6b7b\u4eba\u4e0d\u507f\u547d\uff0csvn \u8fc1\u79fb\u5230 git<\/a>  <\/li><li><a href=\"https:\/\/www.cnblogs.com\/shawnpoo\/p\/SVN-cang-ku-qian-yi-daoGit-de-wan-mei-jie-jue-ban-.html\">SVN\u4ed3\u5e93\u8fc1\u79fb\u5230Git\u7684\u5b8c\u7f8e\u89e3\u51b3\u529e\u6cd5<\/a>  <\/li><li><a href=\"http:\/\/john.albin.net\/git\/convert-subversion-to-git Converting a Subversion repository to Git\">Converting a Subversion repository to Git<\/a><\/li><\/ul>\n","protected":false},"excerpt":{"rendered":"<p>\u9700\u6c42 \u5de5\u4f5c\u91cc\u6253\u7b97\u5c06\u4ee3\u7801\u4ecesvn\u8fc1\u79fb\u5230git\uff0c\u4f46svn\u6bd5\u7adf\u7528\u4e86\u4e00\u6bb5\u65f6\u95f4\uff0c\u63d0\u4ea4\u8bb0\u5f55\u3001tag\u3001release\u7b49\u4fe1\u606f\u5e0c <a href='http:\/\/prayerlaputa.com\/?p=545' class='excerpt-more'>[&#8230;]<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0},"categories":[13,14,25],"tags":[61],"_links":{"self":[{"href":"http:\/\/prayerlaputa.com\/index.php?rest_route=\/wp\/v2\/posts\/545"}],"collection":[{"href":"http:\/\/prayerlaputa.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/prayerlaputa.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/prayerlaputa.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/prayerlaputa.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=545"}],"version-history":[{"count":2,"href":"http:\/\/prayerlaputa.com\/index.php?rest_route=\/wp\/v2\/posts\/545\/revisions"}],"predecessor-version":[{"id":551,"href":"http:\/\/prayerlaputa.com\/index.php?rest_route=\/wp\/v2\/posts\/545\/revisions\/551"}],"wp:attachment":[{"href":"http:\/\/prayerlaputa.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=545"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/prayerlaputa.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=545"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/prayerlaputa.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=545"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}