{"id":704,"date":"2016-06-13T11:08:57","date_gmt":"2016-06-13T03:08:57","guid":{"rendered":"http:\/\/www.shuran.cn\/?p=704"},"modified":"2016-09-01T17:09:05","modified_gmt":"2016-09-01T09:09:05","slug":"git-%e6%96%b0%e5%bb%ba%e5%88%86%e6%94%af%e4%bb%a5%e5%8f%8a%e7%ae%a1%e7%90%86%e5%88%86%e6%94%af","status":"publish","type":"post","link":"https:\/\/www.shuran.cn\/?p=704","title":{"rendered":"git \u65b0\u5efa\u5206\u652f\u4ee5\u53ca\u7ba1\u7406\u5206\u652f"},"content":{"rendered":"<p>\n\t\u5728\u4f60\u7684github\u5206\u652f\u4e0a\uff0c \u4f60\u9700\u8981\u4fdd\u6301\u4f60\u7684\u4e3b\u5206\u652f\u5e72\u51c0\uff0c \u6211\u8bf4\u7684\u5e72\u51c0\u5c31\u662f\u6ca1\u6709\u4efb\u4f55\u6539\u53d8\uff0c\u90a3\u4e48\u4f60\u53ef\u4ee5\u5728\u4efb\u4f55\u65f6\u5019\u4ece\u4f60\u7684\u4e3b\u5206\u652f\u4fee\u5efa\u4e00\u4e2a\u5206\u652f\u3002\u6bcf\u6b21\uff0c \u4f60\u60f3\u63d0\u4ea4\u4e00\u4e2a\u8865\u4e01\u6216\u8005\u4e00\u4e2a\u65b0\u7279\u6027\u65f6\uff0c\u4f60\u9700\u8981\u4e3a\u5b83\u65b0\u5efa\u4e00\u4e2a\u5206\u652f\uff0c\u800c\u8fd9\u4e2a\u5206\u652f\u65e0\u8bba\u5982\u4f55\u90fd\u4f1a\u4ece\u4f60\u7684\u4e3b\u5206\u652f\u590d\u5236\u8fc7\u6765\u3002\n<\/p>\n<p>\n\t&nbsp; &nbsp; &nbsp; \u5f53\u4f60\u8981\u5728\u4e00\u4e2a\u5206\u652f\u505a\u62c9\u8bf7\u6c42\u65f6\uff0c \u4f60\u4e5f\u80fd\u591f\u7ee7\u7eed\u5728\u5176\u4ed6\u5206\u652f\u4e0a\u5de5\u4f5c\uff0c\u800c\u4e14\u4e5f\u80fd\u591f\u5728\u5176\u5b83\u5206\u652f\u4e0a\u505a\u62c9\u8bf7\u6c42\u3002\n<\/p>\n<p>\n\t\u5728\u4f60\u65b0\u5efa\u4e00\u4e2a\u65b0\u5206\u652f\u4ece\u4e3b\u5206\u652f\u4e0a\u62c9\u4e0b\u6765\u6240\u6709\u6539\u53d8\u4e4b\u524d\uff0c\u4f60\u7684\u4e3b\u5206\u652f\u9700\u8981\u786e\u4fdd\u662f\u6700\u65b0\u7684\u3002\n<\/p>\n<p>\n\t&nbsp; &nbsp; &nbsp; \u5728\u672c\u5730\u7535\u8111\u65b0\u5efa\u4e00\u4e2a\u5206\u652f\uff1a git branch &lt;\u65b0\u5206\u652f\u540d\u5b57&gt;\n<\/p>\n<p>\n\t&nbsp; &nbsp; &nbsp; \u5c06\u65b0\u5206\u652f\u53d1\u5e03\u5728github\u4e0a\uff1a git push origin &lt;\u65b0\u5206\u652f\u540d\u5b57&gt; [*\u5982\u679c\u8fb9\u770b\u8fb9\u505a\uff0c\u4f1a\u51fa\u9519\uff0c\u8bf7\u5f80\u4e0b\u770b]\n<\/p>\n<p>\n\t&nbsp; &nbsp; &nbsp; \u5207\u6362\u5230\u4f60\u7684\u65b0\u5206\u652f: git checkout &lt;\u65b0\u5206\u652f\u540d\u5b57&gt; [* \u4e8b\u5b9e\u4e0a\u5207\u6362\u5230\u5176\u5b83\u5206\u652f\u90fd\u662f\u8fd9\u4e2a\u547d\u4ee4]\n<\/p>\n<p>\n\t&nbsp; &nbsp; &nbsp; \u5f53\u4f60\u60f3\u8981\u5728\u4f60\u7684\u5206\u652f\u4e0a\u63d0\u4ea4\u5185\u5bb9\uff0c\u8bf7\u786e\u4fdd\u662f\u5728\u4f60\u7684\u90a3\u4e2a\u5206\u652f\u4e0a\u3002[* \u6211\u7684\u4e00\u7bc7\u535a\u6587\u4e0a\u5199\u5230\u4e86\u5728\u7ec8\u7aef\u4e0a\u663e\u793a\u5f53\u524d\u5206\u652f\u4ee5\u53ca\u663e\u793a\u5f53\u524d\u5206\u652f\u662f\u5426\u505a\u8fc7\u4fee\u6539\u5373\u8be5\u5206\u652f\u662f\u5426\u5e72\u51c0]\n<\/p>\n<p>\n\t&nbsp; &nbsp; &nbsp; \u67e5\u770b\u6240\u6709\u5df2\u5b58\u5728\u7684\u5206\u652f\uff0c\u4f60\u53ef\u4ee5\u4f7f\u7528\uff1a git branch\n<\/p>\n<p>\n\t\u5b83\u5c31\u4f1a\u6709\u5982\u4e0b\u663e\u793a\uff1a\n<\/p>\n<p>\n\tapproval_messages\n<\/p>\n<p>\n\t&nbsp; &nbsp; &nbsp; master\n<\/p>\n<p>\n\t&nbsp; &nbsp; &nbsp; master_clean\n<\/p>\n<p>\n\t[* '\u00b7'\u4ee3\u8868\u4e86\u4f60\u73b0\u5728\u6240\u5728\u5206\u652f]\n<\/p>\n<p>\n\t&nbsp; &nbsp; &nbsp; \u4e3a\u4f60\u7684\u5206\u652f\u52a0\u5165\u4e00\u4e2a\u65b0\u7684\u8fdc\u7a0b\u7aef\uff1a git remote add &lt;\u8fdc\u7a0b\u7aef\u540d\u5b57&gt; &lt;\u5730\u5740&gt;\n<\/p>\n<p>\n\t[* \u524d\u6587\u63d0\u5230\u51fa\u9519\u7684\u5730\u65b9\u5c31\u662f\u7f3a\u5c11\u4e86\u8fd9\u4e00\u6b65\uff0c\u5982\u679c\u4f60\u5728github\u7533\u8bf7\u4e86\u5e10\u53f7\uff0c\u53ef\u4ee5\u65b0\u5efa\u4e00\u4e2a\u4ed3\u5e93\uff0c\u8fd9\u65f6\u5c31\u4f1a\u6709\u4e00\u4e2a\u5730\u5740[git@github.com:\u7528\u6237\u540d\/\u9879\u76ee\u540d.git]\uff0c \u8fdc\u7a0b\u6bb5\u540d\u5b57\u53ef\u4ee5\u968f\u4fbf\u53d6\uff0c\u5982\u4e0a\u6587\u7684origin]\n<\/p>\n<p>\n\t&nbsp; &nbsp; &nbsp; \u901a\u8fc7\u63d0\u4ea4\u5c06\u6240\u6709\u4fee\u6539\u63d0\u4ea4\u5230\u4f60\u7684\u5206\u652f\u4e0a\uff1a git push origin &lt;\u8fdc\u7a0b\u7aef\u5206\u652f&gt; [* \u539f\u6587\u6709\u70b9\u95ee\u9898\uff0c\u8fdc\u7a0b\u7aef\u5206\u652f\u4e00\u822c\u662f\u4e0e\u672c\u5730\u5206\u652f\u662f\u5bf9\u5e94\u7684\uff0c\u5f53\u7136\u4f60\u4e5f\u53ef\u4ee5\u5728\u672c\u5730\u4e00\u4e2a\u5206\u652f\u63d0\u4ea4\u5230\u8fdc\u7a0b\u7aef\u5206\u652f\u7684\u53e6\u4e00\u4e2a\u5206\u652f\u5982\uff1a git push origin master \u63d0\u4ea4\u5230\u8fdc\u7a0b\u7aef\u7684\u4e3b\u5206\u652f\u4e0a]\n<\/p>\n<p>\n\t&nbsp; &nbsp; &nbsp; \u5728\u672c\u5730\u5220\u9664\u4e00\u4e2a\u5206\u652f\uff1a git branch -d &lt;\u672c\u5730\u5206\u652f&gt;\n<\/p>\n<p>\n\t&nbsp; &nbsp; &nbsp;\u5728github\u8fdc\u7a0b\u7aef\u5220\u9664\u4e00\u4e2a\u5206\u652f\uff1a git push origin :&lt;\u8fdc\u7a0b\u7aef\u5206\u652f&gt;\n<\/p>\n<p>\n\t\u552f\u4e00\u4e0d\u540c\u7684\u5c31\u662f\u5192\u53f7\u4ee3\u8868\u4e86\u5220\u9664\n<\/p>\n<p>\n\t&nbsp; &nbsp; &nbsp; \u5982\u679c\u4f60\u60f3\u8981\u6539\u53d8\u9ed8\u8ba4\u5206\u652f\uff0c \u5728github\u4e0a\u662f\u5f88\u5bb9\u6613\u7684\uff0c\u5728\u4f60\u7684\u5206\u652f\u4e0a\u5230Admin\u9875\u9762\uff0c\u5728\u4e0b\u62c9\u83dc\u5355\u91cc\u9009\u62e9\u4f60\u60f3\u8981\u8bbe\u7f6e\u4e3a\u9ed8\u8ba4\u5206\u652f\u7684\u90a3\u4e2a\u5206\u652f\u3002\n<\/p>\n<p>\n\t\u6ce8\uff1a\u672c\u6587\u539f\u6587\u5730\u5740\uff1ahttps:\/\/github.com\/Kunena\/Kunena-2.0\/wiki\/Create-a-new-branch-with-git-and-manage-branches\n<\/p>\n<p>\n\t\n<\/p>\n<p>\n\t\u5206\u652f\u64cd\u4f5c\u547d\u4ee4\uff1a<\/p>\n<p>\u672c\u5730\u540c\u6b65\u8fdc\u7a0b\u7684\u67d0\u4e00\u4e2a\u5206\u652f\uff08\u672c\u5730\u6ca1\u6709\u6b64\u5206\u652f\uff09\u5047\u8bbe dev\u4e3a\u90a3\u4e2a\u5206\u652f\u7684\u540d\u79f0<br \/>\ngit pull &nbsp;\u540c\u6b65\u540e\uff08\u6216\u8005git fetch origin dev \u547d\u4ee4\u6765\u628a\u8fdc\u7a0b\u5206\u652f\u62c9\u5230\u672c\u5730\uff09<\/p>\n<p>git checkout -b dev origin\/dev\u5728\u672c\u5730\u521b\u5efa\u5206\u652fdev\u5e76\u5207\u6362\u5230\u8be5\u5206\u652f\n<\/p>\n<p>\n\t\u8fd9\u65f6\u5019\u4f60\u53ef\u4ee5\u7528git branch \u6765\u67e5\u770b\u672c\u5730\u662f\u5426\u5df2\u7ecf\u6709\u4e86dev\u5206\u652f\u3002<\/p>\n<p>\u5206\u652f\u4e4b\u95f4\u7684\u540c\u6b65\u548c\u5207\u6362<br \/>\ngit checkout dev<br \/>\ngit pull origin dev<\/p>\n<p>\u5982\u679c\u5728master\u5206\u652f\u76f4\u63a5\u6267\u884cgit pull origin dev \u90a3\u4e48\u5c31\u662f\u66f4\u65b0\u5408\u5e76\u4e86\u8fdc\u7a0bdev\u5206\u652f\u5185\u5bb9\u5230\u672c\u5730master\u4e3b\u5206\u652f\u3002<br \/>\n\u6240\u4ee5\u5efa\u8bae\u5206\u6b65\u9aa4\u6267\u884c\u3002<br \/>\n\u5207\u6362\u56de\u5230master \u5206\u652f\uff1agit checkout master<br \/>\n\u5408\u5e76dev\u5206\u652f\u5230master\uff1agit merge dev<\/p>\n<p>\u6ce8\u610f\uff1a\u751f\u4ea7\u73af\u5883\u4e0b\uff0cgit checkout dev \uff0c\u90a3\u4e48\u6574\u4e2a\u7cfb\u7edf\u8fd0\u884c\u8f6c\u6210\u4e86dev\u5206\u652f\u6a21\u5f0f\u4e0b\u3002\u5982\u679c\u51fa\u73b0\u95ee\u9898\uff0c\u90a3\u4e48\u53ef\u80fd\u4f1a\u5f71\u54cd\u7528\u6237\u3002<\/p>\n<p>\u56e0\u6b64\u9884\u53d1\u73af\u5883\u7684\u4e2d\u95f4\u6d4b\u8bd5\u4f5c\u7528\u975e\u5e38\u660e\u663e\uff0c\u5728\u9884\u53d1\u73af\u5883\u4e0b\uff0c\u968f\u610fcheckout\u5206\u652f\uff0c\u89e3\u51b3\u51b2\u7a81\u548c\u6d4b\u8bd5\u7cfb\u7edf\u8fd0\u884c\u72b6\u6001\uff0c\u6700\u540e\u518d\u8fdb\u884c\u751f\u4ea7\u73af\u5883\u7684\u66f4\u65b0\u540c\u6b65\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5728\u4f60\u7684github\u5206\u652f\u4e0a\uff0c \u4f60\u9700\u8981\u4fdd\u6301\u4f60\u7684\u4e3b\u5206\u652f\u5e72\u51c0\uff0c \u6211\u8bf4\u7684\u5e72\u51c0\u5c31\u662f\u6ca1\u6709\u4efb\u4f55\u6539\u53d8\uff0c\u90a3\u4e48\u4f60\u53ef\u4ee5\u5728\u4efb\u4f55\u65f6\u5019\u4ece\u4f60\u7684\u2026 <span class=\"read-more\"><a href=\"https:\/\/www.shuran.cn\/?p=704\">Read More &raquo;<\/a><\/span><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[10],"tags":[63],"class_list":["post-704","post","type-post","status-publish","format-standard","hentry","category-os","tag-git-"],"_links":{"self":[{"href":"https:\/\/www.shuran.cn\/index.php?rest_route=\/wp\/v2\/posts\/704","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.shuran.cn\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.shuran.cn\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.shuran.cn\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.shuran.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=704"}],"version-history":[{"count":4,"href":"https:\/\/www.shuran.cn\/index.php?rest_route=\/wp\/v2\/posts\/704\/revisions"}],"predecessor-version":[{"id":743,"href":"https:\/\/www.shuran.cn\/index.php?rest_route=\/wp\/v2\/posts\/704\/revisions\/743"}],"wp:attachment":[{"href":"https:\/\/www.shuran.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=704"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.shuran.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=704"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.shuran.cn\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=704"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}