{"id":5703,"date":"2022-03-25T21:36:00","date_gmt":"2022-03-25T13:36:00","guid":{"rendered":"https:\/\/damogame.cn:15443\/wordpress\/?p=5703"},"modified":"2022-03-25T21:36:00","modified_gmt":"2022-03-25T13:36:00","slug":"%e4%ba%86%e8%a7%a3-gitflow-%e5%88%86%e6%94%af%e5%b7%a5%e4%bd%9c%e6%b5%81","status":"publish","type":"post","link":"https:\/\/i007.cc\/wordpress\/archives\/5703","title":{"rendered":"\u4e86\u89e3 GitFlow \u5206\u652f\u5de5\u4f5c\u6d41"},"content":{"rendered":"<p class=\"margin-right-xxl-desktop\"><a href=\"https:\/\/docs.microsoft.com\/zh-cn\/learn\/modules\/manage-git-branches-workflows\/5-explore-gitflow-branch-workflow\">\u539f\u6587\u5730\u5740<\/a><\/p>\n<p>&nbsp;<\/p>\n<div class=\"xp-tag position-absolute top-0 right-0 margin-top-xs margin-top-sm-tablet margin-top-lg-desktop margin-top-xs-interactive margin-right-sm margin-right-lg-tablet margin-right-sm-interactive is-complete\" data-progress-uid=\"learn.wwl.manage-git-branches-workflows.explore-gitflow-branch-workflow\">\n<div class=\"xp-tag-hexagon\"><span class=\"xp-tag-icon is-shown-complete docon docon-check\"><span class=\"visually-hidden\">\u5df2\u5b8c\u6210<\/span><\/span><span class=\"xp-tag-xp\">100 XP<\/span><\/div>\n<\/div>\n<ul class=\"metadata page-metadata\">\n<li>7 \u5206\u949f<\/li>\n<\/ul>\n<p>Gitflow \u5de5\u4f5c\u6d41\u662f\u4e00\u79cd Git \u5de5\u4f5c\u6d41\u8bbe\u8ba1\uff0c\u7531 Vincent Driessen \u5728 nvie \u4e0a\u9996\u6b21\u53d1\u5e03\u5e76\u7531\u6b64\u51fa\u540d\u3002<\/p>\n<p>Gitflow \u5de5\u4f5c\u6d41\u5b9a\u4e49\u4e86\u4e00\u79cd\u56f4\u7ed5\u9879\u76ee\u53d1\u5e03\u8bbe\u8ba1\u7684\u4e25\u683c\u7684\u5206\u652f\u6a21\u578b\u3002 \u5b83\u63d0\u4f9b\u4e86\u4e00\u4e2a\u53ef\u9760\u7684\u6846\u67b6\uff0c\u7528\u4e8e\u7ba1\u7406\u66f4\u91cd\u8981\u7684\u9879\u76ee\u3002<\/p>\n<p>Gitflow \u975e\u5e38\u9002\u5408\u5177\u6709\u8ba1\u5212\u53d1\u5e03\u5468\u671f\u7684\u9879\u76ee\u3002<\/p>\n<p>\u8fd9\u79cd\u5de5\u4f5c\u6d41\u4e0d\u4f1a\u8d85\u51fa\u529f\u80fd\u5206\u652f\u5de5\u4f5c\u6d41\u6240\u9700\u6dfb\u52a0\u4efb\u4f55\u65b0\u7684\u6982\u5ff5\u6216\u547d\u4ee4\u3002<\/p>\n<p>\u5b83\u5411\u4e0d\u540c\u5206\u652f\u5206\u914d\u7279\u5b9a\u89d2\u8272\uff0c\u5e76\u5b9a\u4e49\u5b83\u4eec\u5e94\u4f55\u65f6\u4e14\u5982\u4f55\u8fdb\u884c\u4ea4\u4e92\u3002<\/p>\n<p>\u53e6\u5916\uff0c\u5bf9\u4e8e\u529f\u80fd\u5206\u652f\uff0c\u5b83\u8fd8\u4f7f\u7528\u5355\u72ec\u7684\u5206\u652f\u6765\u51c6\u5907\u3001\u7ef4\u62a4\u548c\u8bb0\u5f55\u53d1\u5e03\u60c5\u51b5\u3002<\/p>\n<p>\u800c\u4e14\u4f60\u8fd8\u53ef\u4ee5\u4f7f\u7528\u529f\u80fd\u5206\u652f\u5de5\u4f5c\u6d41\u7684\u6240\u6709\u4f18\u52bf\uff1a\u62c9\u53d6\u8bf7\u6c42\u3001\u9694\u79bb\u8bd5\u9a8c\u548c\u66f4\u9ad8\u6548\u7684\u534f\u4f5c\u3002<\/p>\n<p>\u6b64\u5916\uff0c\u5bf9\u4e8e\u62bd\u8c61\u7684 Gitflow \u5de5\u4f5c\u6d41\u6982\u5ff5\uff0c\u63d0\u4f9b\u4e86\u4e00\u4e2a\u66f4\u5177\u4f53\u7684 git-flow \u5de5\u5177\u96c6\uff0c\u5b83\u4e0e Git \u96c6\u6210\uff0c\u4ee5\u63d0\u4f9b\u4e13\u7528\u7684 Gitflow Git \u547d\u4ee4\u884c\u5de5\u5177\u6269\u5c55\u3002<\/p>\n<h2 id=\"getting-started\">\u5165\u95e8<\/h2>\n<p>Gitflow \u53ea\u662f Git \u5de5\u4f5c\u6d41\u7684\u62bd\u8c61\u6982\u5ff5\u3002 \u8fd9\u610f\u5473\u7740\u5b83\u51b3\u5b9a\u4e86\u8981\u8bbe\u7f6e\u54ea\u4e9b\u7c7b\u578b\u7684\u5206\u652f\u4ee5\u53ca\u5982\u4f55\u5408\u5e76\u5b83\u4eec\u3002 \u6211\u4eec\u5c06\u4ecb\u7ecd\u4ee5\u4e0b\u5206\u652f\u7684\u7528\u9014\u3002<\/p>\n<p>Git-flow \u5de5\u5177\u96c6\u662f\u4e00\u79cd\u57fa\u672c\u547d\u4ee4\u884c\u5de5\u5177\uff0c\u5177\u6709\u4e00\u4e2a\u5b89\u88c5\u8fc7\u7a0b\u3002 Git-flow \u7684\u5b89\u88c5\u8fc7\u7a0b\u975e\u5e38\u7b80\u5355\u3002 Git-flow \u5305\u53ef\u9002\u7528\u4e8e\u591a\u4e2a\u64cd\u4f5c\u7cfb\u7edf\u3002<\/p>\n<p>\u5728 OSX \u7cfb\u7edf\u4e0a\uff0c\u53ef\u6267\u884c brew install git-flow\u3002<\/p>\n<p>\u5728 Windows \u4e0a\uff0c\u9700\u8981\u4e0b\u8f7d\u5e76\u5b89\u88c5 git-flow\u3002<\/p>\n<p>\u5b89\u88c5 git-flow \u540e\uff0c\u53ef\u901a\u8fc7\u8fd0\u884c git flow init \u5728\u9879\u76ee\u4e2d\u4f7f\u7528\u5b83\u3002 Git-flow \u662f\u4e00\u4e2a\u56f4\u7ed5 Git \u7684\u5305\u88c5\u5668\u3002<\/p>\n<p>git flow init \u547d\u4ee4\u662f\u9ed8\u8ba4 git init \u547d\u4ee4\u7684\u6269\u5c55\u3002 \u9664\u4e86\u4e3a\u4f60\u521b\u5efa\u5206\u652f\u5916\uff0c\u5b83\u4e0d\u4f1a\u66f4\u6539\u5b58\u50a8\u5e93\u4e2d\u7684\u4efb\u4f55\u5185\u5bb9\u3002<\/p>\n<p>\u5de5\u4f5c\u539f\u7406\uff1a<\/p>\n<p><span class=\"mx-imgBorder\"><img decoding=\"async\" src=\"https:\/\/docs.microsoft.com\/zh-cn\/learn\/wwl-azure\/manage-git-branches-workflows\/media\/git-branch-main-develop-5a0f697f.png\" alt=\"Git branch representation. Main, and develop.\" data-linktype=\"relative-path\" \/><\/span><\/p>\n<h2 id=\"develop-and-main-branches\">\u5f00\u53d1\u5206\u652f\u548c\u4e3b\u5206\u652f<\/h2>\n<p>\u8fd9\u79cd\u5de5\u4f5c\u6d41\u4f7f\u7528\u4e24\u4e2a\u5206\u652f\u6765\u8bb0\u5f55\u9879\u76ee\u7684\u5386\u53f2\u8bb0\u5f55\uff0c\u800c\u4e0d\u662f\u4f7f\u7528\u4e00\u4e2a\u4e3b\u5206\u652f\u3002<\/p>\n<p>\u4e3b\u5206\u652f\u5b58\u50a8\u5b98\u65b9\u53d1\u5e03\u5386\u53f2\u8bb0\u5f55\uff0c\u800c\u5f00\u53d1\u5206\u652f\u5219\u5145\u5f53\u529f\u80fd\u7684\u96c6\u6210\u5206\u652f\u3002 \u4f7f\u7528\u7248\u672c\u53f7\u6807\u8bb0\u4e3b\u5206\u652f\u4e2d\u6240\u6709\u63d0\u4ea4\u4e5f\u5f88\u65b9\u4fbf\u3002<\/p>\n<p>\u7b2c\u4e00\u6b65\u662f\u4f7f\u7528\u5f00\u53d1\u5206\u652f\u8865\u5145\u9ed8\u8ba4\u4e3b\u5206\u652f\u3002 \u8981\u8fdb\u884c\u6b64\u64cd\u4f5c\u7684\u4e00\u4e2a\u7b80\u5355\u65b9\u6cd5\u5c31\u662f\u8ba9\u5f00\u53d1\u4eba\u5458\u5728\u672c\u5730\u521b\u5efa\u4e00\u4e2a\u7a7a\u7684\u5f00\u53d1\u5206\u652f\u5e76\u63a8\u9001\u5230\u670d\u52a1\u5668\uff1a<\/p>\n<div id=\"code-try-0\" class=\"codeHeader\" data-bi-name=\"code-header\"><span class=\"language\">Cmd<\/span><button class=\"action position-relative\" type=\"button\" data-bi-name=\"copy\" aria-label=\"\u590d\u5236\u4ee3\u7801\"><\/button><button class=\"action position-relative\" type=\"button\" data-bi-name=\"copy\" aria-label=\"\u590d\u5236\u4ee3\u7801\">\u590d\u5236<\/button><\/p>\n<div class=\"successful-copy-alert position-absolute right-0 top-0 left-0 bottom-0 display-flex align-items-center justify-content-center has-text-success-invert has-background-success is-transparent\" aria-hidden=\"true\"><\/div>\n<\/div>\n<pre class=\"has-inner-focus\" tabindex=\"0\"><code class=\"lang-Cmd\" data-author-content=\"git branch develop\r\ngit push -u origin develop\r\n\r\n\">git branch develop\r\ngit push -u origin develop\r\n\r\n<\/code><\/pre>\n<p>\u6b64\u5206\u652f\u5c06\u5305\u542b\u9879\u76ee\u7684\u5b8c\u6574\u5386\u53f2\u8bb0\u5f55\uff0c\u4f46\u4e3b\u5206\u652f\u7684\u5386\u53f2\u8bb0\u5f55\u4e3a\u7cbe\u7b80\u7248\u3002 \u5176\u4ed6\u5f00\u53d1\u4eba\u5458\u73b0\u5728\u5e94\u514b\u9686\u4e2d\u592e\u5b58\u50a8\u5e93\uff0c\u5e76\u521b\u5efa\u7528\u4e8e\u5f00\u53d1\u7684\u8ddf\u8e2a\u5206\u652f\u3002<\/p>\n<p>\u4f7f\u7528 git-flow \u6269\u5c55\u5e93\u65f6\uff0c\u5bf9\u73b0\u6709\u5b58\u50a8\u5e93\u6267\u884c git flow init \u547d\u4ee4\u5c06\u4f1a\u521b\u5efa\u5f00\u53d1\u5206\u652f\uff1a<\/p>\n<div id=\"code-try-1\" class=\"codeHeader\" data-bi-name=\"code-header\"><span class=\"language\">Cmd<\/span><button class=\"action position-relative\" type=\"button\" data-bi-name=\"copy\" aria-label=\"\u590d\u5236\u4ee3\u7801\"><\/button><button class=\"action position-relative\" type=\"button\" data-bi-name=\"copy\" aria-label=\"\u590d\u5236\u4ee3\u7801\">\u590d\u5236<\/button><\/p>\n<div class=\"successful-copy-alert position-absolute right-0 top-0 left-0 bottom-0 display-flex align-items-center justify-content-center has-text-success-invert has-background-success is-transparent\" aria-hidden=\"true\"><\/div>\n<\/div>\n<pre class=\"has-inner-focus\" tabindex=\"0\"><code class=\"lang-Cmd\" data-author-content=\"Initialized empty Git repository in ~\/project\/.git\/\r\nNo branches exist yet. Base branches must be created now.\r\nBranch name for production releases: [main]\r\nBranch name for &quot;next release&quot; development: [develop]\r\n\r\nHow to name your supporting branch prefixes?\r\nFeature branches? [feature\/]\r\nRelease branches? [release\/]\r\nHotfix branches? [hotfix\/]\r\nSupport branches? [support\/]\r\nVersion tag prefix? []\r\n\r\n$ git branch\r\n\r\n* develop\r\nmain\r\n\r\n\">Initialized empty Git repository <span class=\"hljs-keyword\">in<\/span> ~\/project\/.git\/\r\nNo branches <span class=\"hljs-keyword\">exist<\/span> yet. Base branches must be created now.\r\nBranch name <span class=\"hljs-keyword\">for<\/span> production releases: [main]\r\nBranch name <span class=\"hljs-keyword\">for<\/span> \"next release\" development: [develop]\r\n\r\nHow to name your supporting branch prefixes?\r\nFeature branches? [feature\/]\r\nRelease branches? [release\/]\r\nHotfix branches? [hotfix\/]\r\nSupport branches? [support\/]\r\nVersion tag prefix? []\r\n\r\n$ git branch\r\n\r\n* develop\r\nmain\r\n\r\n<\/code><\/pre>\n<h2 id=\"feature-branches\">\u529f\u80fd\u5206\u652f<\/h2>\n<p>\u6bcf\u4e2a\u65b0\u529f\u80fd\u90fd\u5e94\u4f4d\u4e8e\u5176\u5206\u652f\u4e2d\uff0c\u8fd9\u6837\u53ef\u4ee5\u63a8\u9001\u5230\u4e2d\u592e\u5b58\u50a8\u5e93\u8fdb\u884c\u5907\u4efd\/\u534f\u4f5c\u3002<\/p>\n<p>\u4f46\u529f\u80fd\u5206\u652f\u4f7f\u7528\u5f00\u53d1\u4f5c\u4e3a\u5b83\u4eec\u7684\u7236\u5206\u652f\uff0c\u800c\u4e0d\u662f\u4ece\u4e3b\u5206\u652f\u5206\u51fa\u6765\u3002<\/p>\n<p>\u529f\u80fd\u5b8c\u6210\u540e\uff0c\u5b83\u4f1a\u5408\u5e76\u56de\u5f00\u53d1\u4e2d\u3002 \u529f\u80fd\u4e0d\u5e94\u76f4\u63a5\u4e0e\u4e3b\u5206\u652f\u4ea4\u4e92\u3002<\/p>\n<p><span class=\"mx-imgBorder\"><img decoding=\"async\" src=\"https:\/\/docs.microsoft.com\/zh-cn\/learn\/wwl-azure\/manage-git-branches-workflows\/media\/feature-branches-main-develop-features-8d909507.png\" alt=\"Feature branches presentation. Main, develop, and features.\" data-linktype=\"relative-path\" \/><\/span><\/p>\n<p>\u4e0e\u5f00\u53d1\u5206\u652f\u7ec4\u5408\u7684\u529f\u80fd\u5206\u652f\u662f\u529f\u80fd\u5206\u652f\u5de5\u4f5c\u6d41\u3002 \u4f46 Gitflow \u5de5\u4f5c\u6d41\u4e0d\u4f1a\u505c\u6b62\u3002<\/p>\n<p>\u521b\u5efa\u529f\u80fd\u5206\u652f\uff0c\u5206\u652f\u5230\u6700\u65b0\u7684\u5f00\u53d1\u5206\u652f\u4e2d\u3002<\/p>\n<p>\u4e0d\u4f7f\u7528 git-flow \u6269\u5c55\u521b\u5efa\u529f\u80fd\u5206\u652f\uff1a<\/p>\n<div id=\"code-try-2\" class=\"codeHeader\" data-bi-name=\"code-header\"><span class=\"language\">Cmd<\/span><button class=\"action position-relative\" type=\"button\" data-bi-name=\"copy\" aria-label=\"\u590d\u5236\u4ee3\u7801\"><\/button><button class=\"action position-relative\" type=\"button\" data-bi-name=\"copy\" aria-label=\"\u590d\u5236\u4ee3\u7801\">\u590d\u5236<\/button><\/p>\n<div class=\"successful-copy-alert position-absolute right-0 top-0 left-0 bottom-0 display-flex align-items-center justify-content-center has-text-success-invert has-background-success is-transparent\" aria-hidden=\"true\"><\/div>\n<\/div>\n<pre class=\"has-inner-focus\" tabindex=\"0\"><code class=\"lang-Cmd\" data-author-content=\"git checkout develop\r\ngit checkout -b feature_branch\r\n\r\n\">git checkout develop\r\ngit checkout -b feature_branch\r\n\r\n<\/code><\/pre>\n<p>\u4f7f\u7528 git-flow \u6269\u5c55\u65f6\uff1a<\/p>\n<div id=\"code-try-3\" class=\"codeHeader\" data-bi-name=\"code-header\"><span class=\"language\">Cmd<\/span><button class=\"action position-relative\" type=\"button\" data-bi-name=\"copy\" aria-label=\"\u590d\u5236\u4ee3\u7801\"><\/button><button class=\"action position-relative\" type=\"button\" data-bi-name=\"copy\" aria-label=\"\u590d\u5236\u4ee3\u7801\">\u590d\u5236<\/button><\/p>\n<div class=\"successful-copy-alert position-absolute right-0 top-0 left-0 bottom-0 display-flex align-items-center justify-content-center has-text-success-invert has-background-success is-transparent\" aria-hidden=\"true\"><\/div>\n<\/div>\n<pre class=\"has-inner-focus\" tabindex=\"0\"><code class=\"lang-Cmd\" data-author-content=\"git flow feature start feature_branch\r\n\r\n\">git flow feature <span class=\"hljs-built_in\">start<\/span> feature_branch\r\n\r\n<\/code><\/pre>\n<p>\u7ee7\u7eed\u5de5\u4f5c\uff0c\u50cf\u5e73\u65f6\u4e00\u6837\u4f7f\u7528 Git\u3002<\/p>\n<p>\u5b8c\u6210\u529f\u80fd\u7684\u5f00\u53d1\u5de5\u4f5c\u65f6\u5c31\u5b8c\u6210\u4e86\u529f\u80fd\u5206\u652f\uff0c\u4e0b\u4e00\u6b65\u662f\u5c06 feature_branch \u5408\u5e76\u5230\u5f00\u53d1\u4e2d\u3002<\/p>\n<p>\u4e0d\u4f7f\u7528 git-flow \u6269\u5c55\uff1a<\/p>\n<div id=\"code-try-4\" class=\"codeHeader\" data-bi-name=\"code-header\"><span class=\"language\">Cmd<\/span><button class=\"action position-relative\" type=\"button\" data-bi-name=\"copy\" aria-label=\"\u590d\u5236\u4ee3\u7801\"><\/button><button class=\"action position-relative\" type=\"button\" data-bi-name=\"copy\" aria-label=\"\u590d\u5236\u4ee3\u7801\">\u590d\u5236<\/button><\/p>\n<div class=\"successful-copy-alert position-absolute right-0 top-0 left-0 bottom-0 display-flex align-items-center justify-content-center has-text-success-invert has-background-success is-transparent\" aria-hidden=\"true\"><\/div>\n<\/div>\n<pre class=\"has-inner-focus\" tabindex=\"0\"><code class=\"lang-Cmd\" data-author-content=\"git checkout develop\r\ngit merge feature_branch\r\n\r\n\">git checkout develop\r\ngit merge feature_branch\r\n\r\n<\/code><\/pre>\n<p>\u4f7f\u7528 git-flow \u6269\u5c55\uff1a<\/p>\n<div id=\"code-try-5\" class=\"codeHeader\" data-bi-name=\"code-header\"><button class=\"action position-relative\" type=\"button\" data-bi-name=\"copy\" aria-label=\"\u590d\u5236\u4ee3\u7801\"><\/button><button class=\"action position-relative\" type=\"button\" data-bi-name=\"copy\" aria-label=\"\u590d\u5236\u4ee3\u7801\">\u590d\u5236<\/button><\/p>\n<div class=\"successful-copy-alert position-absolute right-0 top-0 left-0 bottom-0 display-flex align-items-center justify-content-center has-text-success-invert has-background-success is-transparent\" aria-hidden=\"true\"><\/div>\n<\/div>\n<pre class=\"has-inner-focus\" tabindex=\"0\"><code data-author-content=\"git flow feature finish feature_branch\r\n\r\n\">git flow feature finish feature_branch\r\n\r\n<\/code><\/pre>\n<h2 id=\"release-branches\">\u53d1\u5e03\u5206\u652f<\/h2>\n<p><span class=\"mx-imgBorder\"><img decoding=\"async\" src=\"https:\/\/docs.microsoft.com\/zh-cn\/learn\/wwl-azure\/manage-git-branches-workflows\/media\/release-branches-main-develop-features-ca1fee60.png\" alt=\"Release branches presentation. Main, develop, and features.\" data-linktype=\"relative-path\" \/><\/span><\/p>\n<p>\u4e00\u65e6\u5f00\u53d1\u83b7\u5f97\u8db3\u591f\u7684\u529f\u80fd\u6765\u53d1\u5e03\uff08\u6216\u8005\u9884\u5b9a\u7684\u53d1\u5e03\u65e5\u671f\u5373\u5c06\u5230\u6765\uff09\uff0c\u4f60\u53ef\u4ece\u5f00\u53d1\u4e2d\u5206\u53c9\u4e00\u4e2a\u53d1\u5e03\u5206\u652f\u3002<\/p>\n<p>\u521b\u5efa\u6b64\u5206\u652f\u5c06\u542f\u52a8\u4e0b\u4e00\u4e2a\u53d1\u5e03\u5468\u671f\uff0c\u56e0\u6b64\u5728\u6b64\u4e4b\u540e\u65e0\u6cd5\u6dfb\u52a0\u4efb\u4f55\u65b0\u529f\u80fd &#8211; \u53ea\u6709 bug \u4fee\u590d\u3001\u6587\u6863\u751f\u6210\u548c\u5176\u4ed6\u9762\u5411\u53d1\u5e03\u7684\u4efb\u52a1\u5e94\u6dfb\u52a0\u8fdb\u6b64\u5206\u652f\u3002<\/p>\n<p>\u51c6\u5907\u597d\u53d1\u5e03\u540e\uff0c\u53d1\u5e03\u5206\u652f\u5c06\u5408\u5e76\u5230\u4e3b\u5206\u652f\u4e2d\uff0c\u5e76\u4f7f\u7528\u7248\u672c\u53f7\u6807\u8bb0\u3002<\/p>\n<p>\u6b64\u5916\uff0c\u5b83\u5e94\u5408\u5e76\u56de\u5f00\u53d1\uff0c\u5f00\u53d1\u53ef\u80fd\u4ece\u53d1\u5e03\u5f00\u59cb\u5c31\u4e00\u76f4\u5728\u8fdb\u884c\u3002<\/p>\n<p>\u4f7f\u7528\u4e13\u7528\u5206\u652f\u51c6\u5907\u53d1\u5e03\uff0c\u4ece\u800c\u4f7f\u4e00\u4e2a\u56e2\u961f\u5b8c\u5584\u5f53\u524d\u53d1\u5e03\uff0c\u800c\u53e6\u4e00\u4e2a\u56e2\u961f\u7ee7\u7eed\u4e3a\u4e0b\u4e00\u53d1\u5e03\u5904\u7406\u529f\u80fd\u3002<\/p>\n<p>\u5b83\u8fd8\u521b\u5efa\u5b9a\u4e49\u660e\u786e\u7684\u5f00\u53d1\u9636\u6bb5\u3002 \u4f8b\u5982\uff0c\u53ef\u4ee5\u8f7b\u6613\u5730\u8bf4\u201c\u8fd9\u5468\u6211\u4eec\u8981\u4e3a\u7248\u672c 4.0 \u505a\u51c6\u5907\u201d\uff0c\u5e76\u5728\u5b58\u50a8\u5e93\u7ed3\u6784\u4e2d\u67e5\u770b\u5b83\u3002<\/p>\n<p>\u53d1\u5e03\u5206\u652f\u7684\u521b\u5efa\u662f\u53e6\u4e00\u4e2a\u7b80\u5355\u7684\u5206\u652f\u64cd\u4f5c\u3002 \u4e0e\u529f\u80fd\u5206\u652f\u4e00\u6837\uff0c\u53d1\u5e03\u5206\u652f\u4e5f\u57fa\u4e8e\u5f00\u53d1\u5206\u652f\u3002<\/p>\n<p>\u53ef\u4f7f\u7528\u4ee5\u4e0b\u65b9\u6cd5\u521b\u5efa\u4e00\u4e2a\u65b0\u7684\u53d1\u5e03\u5206\u652f\u3002<\/p>\n<p>\u4e0d\u4f7f\u7528 git-flow \u6269\u5c55\uff1a<\/p>\n<div id=\"code-try-6\" class=\"codeHeader\" data-bi-name=\"code-header\"><span class=\"language\">Cmd<\/span><button class=\"action position-relative\" type=\"button\" data-bi-name=\"copy\" aria-label=\"\u590d\u5236\u4ee3\u7801\"><\/button><button class=\"action position-relative\" type=\"button\" data-bi-name=\"copy\" aria-label=\"\u590d\u5236\u4ee3\u7801\">\u590d\u5236<\/button><\/p>\n<div class=\"successful-copy-alert position-absolute right-0 top-0 left-0 bottom-0 display-flex align-items-center justify-content-center has-text-success-invert has-background-success is-transparent\" aria-hidden=\"true\"><\/div>\n<\/div>\n<pre class=\"has-inner-focus\" tabindex=\"0\"><code class=\"lang-Cmd\" data-author-content=\"git checkout develop\r\ngit checkout -b release\/0.1.0\r\n&#96;&#96;&#96; cmd\r\n\r\nWhen using the git-flow extensions:\r\n\r\n&#96;&#96;&#96; cmd\r\n$ git flow release start 0.1.0\r\nSwitched to a new branch 'release\/0.1.0'\r\n\r\n\">git checkout develop\r\ngit checkout -b release\/<span class=\"hljs-number\">0<\/span>.<span class=\"hljs-number\">1<\/span>.<span class=\"hljs-number\">0<\/span>\r\n``` <span class=\"hljs-built_in\">cmd<\/span>\r\n\r\nWhen using the git-flow extensions:\r\n\r\n``` <span class=\"hljs-built_in\">cmd<\/span>\r\n$ git flow release <span class=\"hljs-built_in\">start<\/span> <span class=\"hljs-number\">0<\/span>.<span class=\"hljs-number\">1<\/span>.<span class=\"hljs-number\">0<\/span>\r\nSwitched to a new branch 'release\/<span class=\"hljs-number\">0<\/span>.<span class=\"hljs-number\">1<\/span>.<span class=\"hljs-number\">0<\/span>'\r\n\r\n<\/code><\/pre>\n<p>\u53d1\u5e03\u51c6\u5907\u5c31\u7eea\u540e\uff0c\u5b83\u5c06\u5408\u5e76\u5230\u4e3b\u5206\u652f\u548c\u5f00\u53d1\u5206\u652f\u4e2d\u3002 \u7136\u540e\uff0c\u5c06\u5220\u9664\u53d1\u5e03\u5206\u652f\u3002<\/p>\n<p>\u5408\u5e76\u56de\u5f00\u53d1\u5206\u652f\u81f3\u5173\u91cd\u8981\uff0c\u56e0\u4e3a\u5173\u952e\u66f4\u65b0\u53ef\u80fd\u5df2\u6dfb\u52a0\u5230\u53d1\u5e03\u5206\u652f\u3002 \u6b64\u5916\uff0c\u5b83\u4eec\u8fd8\u9700\u53ef\u4f9b\u65b0\u529f\u80fd\u8bbf\u95ee\u3002<\/p>\n<p>\u5982\u679c\u4f60\u7684\u7ec4\u7ec7\u8981\u6c42\u8fdb\u884c\u4ee3\u7801\u8bc4\u5ba1\uff0c\u8fd9\u5c06\u662f\u7528\u4e8e\u62c9\u53d6\u8bf7\u6c42\u7684\u7406\u60f3\u4f4d\u7f6e\u3002<\/p>\n<p>\u82e5\u8981\u5b8c\u6210\u53d1\u5e03\u5206\u652f\uff0c\u8bf7\u4f7f\u7528\u4ee5\u4e0b\u65b9\u6cd5\uff1a<\/p>\n<p>\u4e0d\u4f7f\u7528 git-flow \u6269\u5c55\uff1a<\/p>\n<div id=\"code-try-7\" class=\"codeHeader\" data-bi-name=\"code-header\"><span class=\"language\">Cmd<\/span><button class=\"action position-relative\" type=\"button\" data-bi-name=\"copy\" aria-label=\"\u590d\u5236\u4ee3\u7801\"><\/button><button class=\"action position-relative\" type=\"button\" data-bi-name=\"copy\" aria-label=\"\u590d\u5236\u4ee3\u7801\">\u590d\u5236<\/button><\/p>\n<div class=\"successful-copy-alert position-absolute right-0 top-0 left-0 bottom-0 display-flex align-items-center justify-content-center has-text-success-invert has-background-success is-transparent\" aria-hidden=\"true\"><\/div>\n<\/div>\n<pre class=\"has-inner-focus\" tabindex=\"0\"><code class=\"lang-Cmd\" data-author-content=\"git checkout develop\r\ngit merge release\/0.1.0\r\n\r\n\">git checkout develop\r\ngit merge release\/<span class=\"hljs-number\">0<\/span>.<span class=\"hljs-number\">1<\/span>.<span class=\"hljs-number\">0<\/span>\r\n\r\n<\/code><\/pre>\n<p>\u6216\u4f7f\u7528 git-flow \u6269\u5c55\uff1a<\/p>\n<div id=\"code-try-8\" class=\"codeHeader\" data-bi-name=\"code-header\"><span class=\"language\">Cmd<\/span><button class=\"action position-relative\" type=\"button\" data-bi-name=\"copy\" aria-label=\"\u590d\u5236\u4ee3\u7801\"><\/button><button class=\"action position-relative\" type=\"button\" data-bi-name=\"copy\" aria-label=\"\u590d\u5236\u4ee3\u7801\">\u590d\u5236<\/button><\/p>\n<div class=\"successful-copy-alert position-absolute right-0 top-0 left-0 bottom-0 display-flex align-items-center justify-content-center has-text-success-invert has-background-success is-transparent\" aria-hidden=\"true\"><\/div>\n<\/div>\n<pre class=\"has-inner-focus\" tabindex=\"0\"><code class=\"lang-Cmd\" data-author-content=\"git checkout main\r\ngit checkout merge release\/0.1.0\r\ngit flow release finish '0.1.0'\r\n\r\n\">git checkout main\r\ngit checkout merge release\/<span class=\"hljs-number\">0<\/span>.<span class=\"hljs-number\">1<\/span>.<span class=\"hljs-number\">0<\/span>\r\ngit flow release finish '<span class=\"hljs-number\">0<\/span>.<span class=\"hljs-number\">1<\/span>.<span class=\"hljs-number\">0<\/span>'\r\n\r\n<\/code><\/pre>\n<p><span class=\"mx-imgBorder\"><img decoding=\"async\" src=\"https:\/\/docs.microsoft.com\/zh-cn\/learn\/wwl-azure\/manage-git-branches-workflows\/media\/branches-main-hotfix-release-develop-features-75d33a59.png\" alt=\"Release branches presentation. Main, hotfix, release, develop, and features.\" data-linktype=\"relative-path\" \/><\/span><\/p>\n<p>\u7ef4\u62a4\u6216\u201c\u4fee\u8865\u7a0b\u5e8f\u201d\u5206\u652f\u7528\u4e8e\u5feb\u901f\u4fee\u8865\u751f\u4ea7\u53d1\u5e03\u3002 \u4fee\u8865\u7a0b\u5e8f\u5206\u652f\u4e0e\u53d1\u5e03\u5206\u652f\u548c\u529f\u80fd\u5206\u652f\u7c7b\u4f3c\uff0c\u53ea\u4e0d\u8fc7\u5b83\u4eec\u57fa\u4e8e\u4e3b\u5206\u652f\u800c\u975e\u5f00\u53d1\u5206\u652f\u3002<\/p>\n<p>\u5b83\u662f\u552f\u4e00\u5e94\u76f4\u63a5\u4ece\u4e3b\u5206\u652f\u5206\u53c9\u7684\u5206\u652f\u3002<\/p>\n<p>\u4fee\u590d\u5b8c\u6210\u540e\uff0c\u5b83\u5e94\u5408\u5e76\u5230\u4e3b\u5206\u652f\u548c\u5f00\u53d1\u5206\u652f\u4e2d\u3002 \u6216\u662f\u6700\u65b0\u7684\u53d1\u5e03\u5206\u652f\u3002<\/p>\n<p>\u6b64\u5916\uff0c\u4e3b\u5206\u652f\u5e94\u8be5\u7528\u66f4\u65b0\u7684\u7248\u672c\u53f7\u8fdb\u884c\u6807\u8bb0\u3002<\/p>\n<p>\u4f7f\u7528\u4e00\u4e2a\u4e13\u7528\u4e8e bug \u4fee\u590d\u7684\u5f00\u53d1\u884c\uff0c\u53ef\u8ba9\u4f60\u7684\u56e2\u961f\u65e0\u9700\u4e2d\u65ad\u5de5\u4f5c\u6d41\u7684\u5176\u4f59\u90e8\u5206\u5373\u53ef\u89e3\u51b3\u95ee\u9898\u3002 \u6216\u8005\u7b49\u5f85\u4e0b\u4e00\u4e2a\u53d1\u5e03\u5468\u671f\u3002<\/p>\n<p>\u53ef\u5c06\u7ef4\u62a4\u5206\u652f\u89c6\u4e3a\u76f4\u63a5\u4e0e\u4e3b\u5206\u652f\u4e00\u8d77\u5de5\u4f5c\u7684\u4e34\u65f6\u53d1\u5e03\u5206\u652f\u3002 \u53ef\u4f7f\u7528\u4ee5\u4e0b\u65b9\u6cd5\u521b\u5efa\u4fee\u8865\u7a0b\u5e8f\u5206\u652f\uff1a<\/p>\n<p>\u4e0d\u4f7f\u7528 git-flow \u6269\u5c55\uff1a<\/p>\n<div id=\"code-try-9\" class=\"codeHeader\" data-bi-name=\"code-header\"><span class=\"language\">Cmd<\/span><button class=\"action position-relative\" type=\"button\" data-bi-name=\"copy\" aria-label=\"\u590d\u5236\u4ee3\u7801\"><\/button><button class=\"action position-relative\" type=\"button\" data-bi-name=\"copy\" aria-label=\"\u590d\u5236\u4ee3\u7801\">\u590d\u5236<\/button><\/p>\n<div class=\"successful-copy-alert position-absolute right-0 top-0 left-0 bottom-0 display-flex align-items-center justify-content-center has-text-success-invert has-background-success is-transparent\" aria-hidden=\"true\"><\/div>\n<\/div>\n<pre class=\"has-inner-focus\" tabindex=\"0\"><code class=\"lang-Cmd\" data-author-content=\"git checkout main\r\ngit checkout -b hotfix_branch\r\n\r\n\">git checkout main\r\ngit checkout -b hotfix_branch\r\n\r\n<\/code><\/pre>\n<p>\u4f7f\u7528 git-flow \u6269\u5c55\u65f6\uff1a<\/p>\n<div id=\"code-try-10\" class=\"codeHeader\" data-bi-name=\"code-header\"><span class=\"language\">Cmd<\/span><button class=\"action position-relative\" type=\"button\" data-bi-name=\"copy\" aria-label=\"\u590d\u5236\u4ee3\u7801\"><\/button><button class=\"action position-relative\" type=\"button\" data-bi-name=\"copy\" aria-label=\"\u590d\u5236\u4ee3\u7801\">\u590d\u5236<\/button><\/p>\n<div class=\"successful-copy-alert position-absolute right-0 top-0 left-0 bottom-0 display-flex align-items-center justify-content-center has-text-success-invert has-background-success is-transparent\" aria-hidden=\"true\"><\/div>\n<\/div>\n<pre class=\"has-inner-focus\" tabindex=\"0\"><code class=\"lang-Cmd\" data-author-content=\"$ git flow hotfix start hotfix_branch\r\n\r\n\">$ git flow hotfix <span class=\"hljs-built_in\">start<\/span> hotfix_branch\r\n\r\n<\/code><\/pre>\n<p>\u4e0e\u53d1\u5e03\u5206\u652f\u7684\u5b8c\u6210\u4e00\u6837\uff0c\u4fee\u8865\u7a0b\u5e8f\u5206\u652f\u5c06\u5408\u5e76\u5230\u4e3b\u5206\u652f\u548c\u5f00\u53d1\u5206\u652f\u4e2d\u3002<\/p>\n<div id=\"code-try-11\" class=\"codeHeader\" data-bi-name=\"code-header\"><span class=\"language\">Cmd<\/span><button class=\"action position-relative\" type=\"button\" data-bi-name=\"copy\" aria-label=\"\u590d\u5236\u4ee3\u7801\"><\/button><button class=\"action position-relative\" type=\"button\" data-bi-name=\"copy\" aria-label=\"\u590d\u5236\u4ee3\u7801\">\u590d\u5236<\/button><\/p>\n<div class=\"successful-copy-alert position-absolute right-0 top-0 left-0 bottom-0 display-flex align-items-center justify-content-center has-text-success-invert has-background-success is-transparent\" aria-hidden=\"true\"><\/div>\n<\/div>\n<pre class=\"has-inner-focus\" tabindex=\"0\"><code class=\"lang-Cmd\" data-author-content=\"git checkout main\r\ngit merge hotfix_branch\r\ngit checkout develop\r\ngit merge hotfix_branch\r\ngit branch -D hotfix_branch\r\n$ git flow hotfix finish hotfix_branch\r\n\r\n\">git checkout main\r\ngit merge hotfix_branch\r\ngit checkout develop\r\ngit merge hotfix_branch\r\ngit branch -D hotfix_branch\r\n$ git flow hotfix finish hotfix_branch\r\n\r\n<\/code><\/pre>\n<p>\u4e86\u89e3 Gitflow \u7684\u4e00\u4e9b\u5173\u952e\u8981\u70b9\u5305\u62ec\uff1a<\/p>\n<ul>\n<li>\u5de5\u4f5c\u6d41\u975e\u5e38\u9002\u7528\u4e8e\u57fa\u4e8e\u53d1\u5e03\u7684\u8f6f\u4ef6\u5de5\u4f5c\u6d41\u3002<\/li>\n<li>Gitflow \u4e3a\u5c06\u4fee\u8865\u7a0b\u5e8f\u63a8\u9001\u5230\u751f\u4ea7\u63d0\u4f9b\u4e13\u7528\u901a\u9053\u3002<\/li>\n<\/ul>\n<p>Gitflow \u7684\u603b\u4f53\u6d41\u662f\uff1a<\/p>\n<ul>\n<li>\u4ece\u4e3b\u5206\u652f\u521b\u5efa\u5f00\u53d1\u5206\u652f\u3002<\/li>\n<li>\u4ece\u5f00\u53d1\u5206\u652f\u521b\u5efa\u53d1\u5e03\u5206\u652f\u3002<\/li>\n<li>\u4ece\u5f00\u53d1\u5206\u652f\u521b\u5efa\u529f\u80fd\u5206\u652f\u3002<\/li>\n<li>\u529f\u80fd\u5b8c\u6210\u540e\uff0c\u5b83\u5c06\u5408\u5e76\u5230\u5f00\u53d1\u5206\u652f\u4e2d\u3002<\/li>\n<li>\u53d1\u5e03\u5206\u652f\u5b8c\u6210\u540e\uff0c\u4f1a\u5408\u5e76\u5230\u5f00\u53d1\u5206\u652f\u548c\u4e3b\u5206\u652f\u4e2d\u3002<\/li>\n<li>\u5982\u679c\u68c0\u6d4b\u5230\u4e3b\u5206\u652f\u4e2d\u5b58\u5728\u95ee\u9898\uff0c\u5219\u4ece\u4e3b\u5206\u652f\u521b\u5efa\u4e00\u4e2a\u4fee\u8865\u7a0b\u5e8f\u5206\u652f\u3002<\/li>\n<li>\u4fee\u8865\u7a0b\u5e8f\u5b8c\u6210\u540e\uff0c\u4f1a\u5408\u5e76\u5230\u5f00\u53d1\u5206\u652f\u548c\u4e3b\u5206\u652f\u4e2d\u3002<\/li>\n<\/ul>\n<div id=\"next-section\" class=\"modular-content-container is-hidden-portrait\">\n<div>\n<hr class=\"hr\" \/>\n<div>\n<h2 class=\"title is-4 margin-top-none\">\u4e0b\u4e00\u5355\u5143: \u4e86\u89e3\u5206\u53c9\u5de5\u4f5c\u6d41<\/h2>\n<\/div>\n<\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>\u539f\u6587\u5730\u5740 &nbsp; \u5df2\u5b8c\u6210100 X<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"colormag_page_container_layout":"default_layout","colormag_page_sidebar_layout":"default_layout","footnotes":""},"categories":[24],"tags":[121],"class_list":["post-5703","post","type-post","status-publish","format-standard","hentry","category-value_docs","tag-05-"],"_links":{"self":[{"href":"https:\/\/i007.cc\/wordpress\/wp-json\/wp\/v2\/posts\/5703","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/i007.cc\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/i007.cc\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/i007.cc\/wordpress\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/i007.cc\/wordpress\/wp-json\/wp\/v2\/comments?post=5703"}],"version-history":[{"count":0,"href":"https:\/\/i007.cc\/wordpress\/wp-json\/wp\/v2\/posts\/5703\/revisions"}],"wp:attachment":[{"href":"https:\/\/i007.cc\/wordpress\/wp-json\/wp\/v2\/media?parent=5703"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/i007.cc\/wordpress\/wp-json\/wp\/v2\/categories?post=5703"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/i007.cc\/wordpress\/wp-json\/wp\/v2\/tags?post=5703"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}