{"id":886,"date":"2022-01-05T22:03:43","date_gmt":"2022-01-05T14:03:43","guid":{"rendered":"https:\/\/www.dd-home.top\/?p=886"},"modified":"2022-04-10T23:14:05","modified_gmt":"2022-04-10T15:14:05","slug":"svn%e8%bf%81%e7%a7%bb%e5%88%b0git%e6%9c%8d%e5%8a%a1%e5%99%a8","status":"publish","type":"post","link":"https:\/\/www.dd-home.top\/?p=886","title":{"rendered":"SVN\u8fc1\u79fb\u5230git\u670d\u52a1\u5668"},"content":{"rendered":"<h6><\/h6>\n<p><!--more--><\/p>\n<h6 class=\"md-end-block md-heading\"><span class=\"md-plain md-expand\">1.\u521b\u5efa\u6587\u4ef6\u5939\uff0c\u4f8b\u5982Demo<\/span><\/h6>\n<h6 class=\"md-end-block md-heading md-focus\"><span class=\"md-plain md-expand\">2.\u6253\u5f00 git bash here\uff0c\u5efa\u8bae\u5982\u6b64\uff0ccmd\u4e5f\u884c<\/span><\/h6>\n<h6 class=\"md-end-block md-heading\"><span class=\"md-plain\">3.\u521b\u5efausers.txt<\/span><\/h6>\n<pre class=\"md-fences md-end-block ty-contain-cm modeLoaded\" lang=\"html\" spellcheck=\"false\"><span role=\"presentation\">\u7528\u6237\u540d=\u7528\u6237\u540d<span class=\"cm-tag cm-bracket\">&lt;<\/span><span class=\"cm-tag\">\u90ae\u7bb1<\/span><span class=\"cm-tag cm-bracket\">&gt;<\/span><\/span>\r\n<span role=\"presentation\">Nbad=Nbad<span class=\"cm-tag cm-bracket\">&lt;<\/span><span class=\"cm-tag\">xxxx@qq.com<\/span><span class=\"cm-tag cm-bracket\">&gt;<\/span><\/span><\/pre>\n<h6 class=\"md-end-block md-heading\"><span class=\"md-plain\">4.\u590d\u5236Svn\u53ca\u5176\u63d0\u4ea4\u8bb0\u5f55<\/span><\/h6>\n<p>\u4e3b\u8981\u662f\u540c\u6b65trunk\u91cc\u9762\u7684\u9879\u76ee\uff0ctag\u4e0d\u505a\u5904\u7406\u7684\u3002<\/p>\n<pre class=\"md-fences md-end-block ty-contain-cm modeLoaded\" lang=\"shell\" spellcheck=\"false\"><span role=\"presentation\"><span class=\"cm-builtin\">git<\/span> svn clone svn:\/\/xxxxx <span class=\"cm-attribute\">--authors-file<\/span><span class=\"cm-operator\">=<\/span>users.txt <span class=\"cm-attribute\">--no-metadata<\/span> <span class=\"cm-attribute\">--trunk<\/span><span class=\"cm-operator\">=<\/span>trunk <span class=\"cm-attribute\">--prefix<\/span> <span class=\"cm-string\">\"\"<\/span> <span class=\"cm-attribute\">-s<\/span> my_project\r\n<\/span><\/pre>\n<h6>\u590d\u5236\u6307\u5b9a\u7684tag\u6216branches<\/h6>\n<pre class=\"md-fences md-end-block ty-contain-cm modeLoaded\" lang=\"shell\" spellcheck=\"false\"><span role=\"presentation\">git svn clone -T branches\/xxx svn:\/\/xxxx --authors-file=users.txt --no-metadata --prefix \"\" -s my_project\r\n<\/span><\/pre>\n<p>&nbsp;<\/p>\n<p class=\"md-end-block md-p\">\u7b2c\u4e8c\u79cd\u65b9\u5f0f<\/p>\n<p><code>git svn init svn:\/\/xxxxxxxxxx<br \/>\ngit svn fetch --authors-file=users.txt<\/code><\/p>\n<h6 class=\"md-end-block md-heading\"><span class=\"md-plain\">5.\u67e5\u770b\u4e4b\u524d\u7684\u63d0\u4ea4\u8bb0\u5f55<\/span><\/h6>\n<pre class=\"md-fences md-end-block ty-contain-cm modeLoaded\" lang=\"shell\" spellcheck=\"false\"><span role=\"presentation\"><span class=\"cm-builtin\">git<\/span> log<\/span><\/pre>\n<h6 class=\"md-end-block md-heading\"><span class=\"md-plain\">6.\u5173\u8054\u8fdc\u7a0b\u4ed3\u5e93<\/span><\/h6>\n<pre class=\"md-fences md-end-block ty-contain-cm modeLoaded\" lang=\"shell\" spellcheck=\"false\"><span role=\"presentation\"><span class=\"cm-builtin\">git<\/span> remote add origin  https:\/\/xxxxx.git<\/span><\/pre>\n<h6 class=\"md-end-block md-heading\"><span class=\"md-plain\">7.\u63d0\u4ea4\u5230git<\/span><\/h6>\n<pre class=\"md-fences md-end-block ty-contain-cm modeLoaded\" lang=\"shell\" spellcheck=\"false\"><span role=\"presentation\"><span class=\"cm-builtin\">git<\/span> push <span class=\"cm-attribute\">-u<\/span> origin master<\/span><\/pre>\n<p class=\"md-end-block md-p\"><span class=\"md-plain\">\u5982\u679c\u51fa\u73b0\u5f02\u5e38<\/span><\/p>\n<pre class=\"md-fences md-end-block ty-contain-cm modeLoaded\" lang=\"shell\" spellcheck=\"false\"><span role=\"presentation\">error: failed to push some refs to <span class=\"cm-string\">'https:xxxxxx.git'<\/span><\/span>\r\n<span role=\"presentation\">hint: Updates were rejected because the tip of your current branch is behind<\/span>\r\n<span role=\"presentation\">hint: its remote counterpart. Integrate the remote changes (e.g.<\/span>\r\n<span role=\"presentation\">hint: <span class=\"cm-string\">'git pull ...'<\/span>) before pushing again.<\/span>\r\n<span role=\"presentation\">hint: See the <span class=\"cm-string\">'Note about fast-forwards'<\/span> <span class=\"cm-keyword\">in<\/span> <span class=\"cm-string\">'git push --help'<\/span> <span class=\"cm-keyword\">for<\/span> details.<\/span><\/pre>\n<p class=\"md-end-block md-p\"><span class=\"md-plain\">\u6267\u884c\u4e0b\u9762\u7684\u63d0\u4ea4\u65b9\u5f0f<\/span><\/p>\n<pre class=\"md-fences md-end-block ty-contain-cm modeLoaded\" lang=\"she\" spellcheck=\"false\"><span role=\"presentation\">git push -u origin master -f<\/span><\/pre>\n","protected":false},"excerpt":{"rendered":"","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-886","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/www.dd-home.top\/index.php?rest_route=\/wp\/v2\/posts\/886","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.dd-home.top\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.dd-home.top\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.dd-home.top\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.dd-home.top\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=886"}],"version-history":[{"count":6,"href":"https:\/\/www.dd-home.top\/index.php?rest_route=\/wp\/v2\/posts\/886\/revisions"}],"predecessor-version":[{"id":888,"href":"https:\/\/www.dd-home.top\/index.php?rest_route=\/wp\/v2\/posts\/886\/revisions\/888"}],"wp:attachment":[{"href":"https:\/\/www.dd-home.top\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=886"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.dd-home.top\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=886"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.dd-home.top\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=886"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}