{"id":2233,"date":"2018-06-19T00:41:36","date_gmt":"2018-06-18T16:41:36","guid":{"rendered":"http:\/\/www.brofive.org\/?p=2233"},"modified":"2018-12-16T22:18:57","modified_gmt":"2018-12-16T14:18:57","slug":"gitlab-flow%ef%bc%9a%e4%bb%8b%e4%ba%8egitflow%e5%92%8cgithub-flow%e4%b9%8b%e9%97%b4%ef%bc%81","status":"publish","type":"post","link":"http:\/\/www.brofive.net\/?p=2233","title":{"rendered":"Git \u4ee3\u7801\u5206\u652f\u6a21\u578b\uff082\uff09\uff1aGitLab Flow\u4ecb\u4e8eGitFlow\u548cGithub Flow\u4e4b\u95f4\uff01"},"content":{"rendered":"<p><span style=\"font-size: large;\">\u611f\u8c22WHS\uff0c\u5173\u6ce8\u4e86\u53e6\u5916\u4e00\u4e2aGit\u98ce\u683c\u7684\u5206\u652f\u7ba1\u7406\u6a21\u578b\uff0c<\/span><a href=\"https:\/\/about.gitlab.com\/2014\/09\/29\/gitlab-flow\/\"><span style=\"font-size: large;\">GitLab Flow<\/span><\/a><span style=\"font-size: large;\">\u662f2014\u5e74\u7531GitLab\u6b63\u5f0f\u53d1\u5e03\u7684\u3002\u770b\u4e86\u4e00\u4e0bGitLab\u7684\u6210\u5458\uff0c\u904d\u5e03\u6574\u4e2a\u4e16\u754c\uff0c\u5f00\u59cb\u8fd8\u4ee5\u4e3aGitFlow\u662f\u5176\u4e2d\u67d0\u4e2a\u54e5\u4eec\u603b\u7ed3\u5199\u4e0b\u7684\uff0c\u540e\u6765\u4ed4\u7ec6\u4e00\u770b\uff0c\u662f\u4ed6\u4eec\u7684CEO <\/span><a href=\"https:\/\/about.gitlab.com\/team\/#sytses\"><span style=\"font-size: large;\">Sid Sijbrandij<\/span><\/a><span style=\"font-size: large;\">\u5199\u4e0b\u6765\u7684\uff01\uff01\u6309\u7167Sid\u7684\u8bf4\u6cd5\u3002GitLab Flow\u6700\u5927\u7684\u7279\u70b9\u662f\u5c06FDD\u3001Feature\u5206\u652f\u4e0eIssue Tracking \u7ed3\u5408\u5728\u4e00\u8d77\u4e86\u3002\u8ba9\u6211\u4eec\u770b\u770b\u5230\u5e95\u662f\u4ec0\u4e48\u6837\u7684\u3002<\/span><\/p>\n<p><em>\u672c\u7cfb\u5217\u4e00\u51713\u7bc7\u6587\u7ae0\uff1a<\/em><\/p>\n<p><em><a href=\"http:\/\/www.brofive.net\/?p=2165\">\uff081\uff09GitFlow\u3001GitHubFlow \u548c TBD<\/a><\/em><\/p>\n<p><em><a href=\"http:\/\/www.brofive.net\/?p=2233\">\uff082\uff09GitLab Flow<\/a><\/em><\/p>\n<p><em><a href=\"http:\/\/www.brofive.net\/?p=4352\">\uff083\uff09Atlassian Simple Git Flow &amp; Google Upstrea<\/a><\/em><\/p>\n<p><span style=\"font-size: large;\"><strong>\u4e00\u3001\u5173\u4e8e\u5206\u652f\u6a21\u578b<\/strong><\/span><\/p>\n<p><span style=\"font-size: large;\">Sid\u8ba4\u4e3aGitflow\u8fc7\u4e8e\u590d\u6742\uff0c\u800c\u4e14\u7531\u4e8e\u5c06Master\u5206\u652f\u7528\u4e8e\u4ea4\u4ed8\uff0c\u5bfc\u81f4\u5f88\u591a\u9ed8\u8ba4\u5728master\u5206\u652f\u96c6\u6210\u7684\u5de5\u5177\u96be\u4ee5\u4f7f\u7528\u3002\u800cGitHub Flow\u53c8\u663e\u5f97\u8fc7\u4e8e\u7b80\u5355\u3002\u4e0a\u8ff0\u4e24\u8005\u5747\u6709\u4e00\u5b9a\u7684\u9002\u7528\u573a\u666f\uff0c\u800cSid\u8ba4\u4e3aGitLab Flow\u662f\u9762\u5411CD\u7684\u573a\u666f\uff0c\u56e0\u6b64\u5404\u79cd\u8bbe\u8ba1\u8981\u9762\u5411CD\u7684\u9700\u6c42\uff0c\u5305\u62ec\u5982\u4e0b\uff1a<\/span><\/p>\n<p><span style=\"font-size: large;\">1\u3001\u5c3d\u53ef\u80fd\u5ef6\u540eRelease\u5206\u652f\uff08\u51c6\u5907\u4ea4\u4ed8\uff09\u7684\u521b\u5efa\uff0c\u4ee5\u4fbf\u96c6\u6210\u66f4\u591a\u7684Fix\u548cFeature<\/span><\/p>\n<p><span style=\"font-size: large;\">2\u3001\u8003\u8651\u5230Master\u662f\u5de5\u5177\u94fe\u9636\u6bb5\u6027\u4ea4\u4ed8\u7684\uff0c\u8fd9\u4e2a\u8282\u594f\u548c\u7248\u672c\u4ea4\u4ed8\u8282\u594f\u80af\u5b9a\u6709\u5dee\u5f02\uff0c\u9700\u8981\u8003\u8651\u9694\u79bbMaster\u548cProduction<\/span><\/p>\n<p><span style=\"font-size: large;\">3\u3001\u5982\u679c\u6d89\u53ca\u5230\u8f83\u591a\u7684\u73b0\u573a\u73af\u5883\u6d4b\u8bd5\uff0c\u8fd8\u53ef\u4ee5\u5efa\u7acb\u53e6\u5916\u4e00\u4e2aPre-Production\u5206\u652f<\/span><\/p>\n<p><span style=\"font-size: large;\">4\u3001master &#8211;&gt;pre-production &#8211;&gt; production\u662f\u6b63\u5e38\u7684bugfix\u63d0\u4ea4\u6b21\u5e8f\uff0c\u5373\u4fbf\u662f\u5bf9\u4e8e\u7d27\u6025patch\uff0c\u4e5f\u8981\u5c3d\u53ef\u80fd\u9075\u5faa\u4e0a\u6e38\u4f18\u5148\u66f4\u65b0\u7684\u7b56\u7565<\/span><\/p>\n<p><a href=\"http:\/\/www.brofive.net\/wp-content\/uploads\/2018\/06\/clip_image001-6.png\"><img loading=\"lazy\" decoding=\"async\" style=\"display: inline; border: 0px;\" title=\"clip_image001\" src=\"http:\/\/www.brofive.net\/wp-content\/uploads\/2018\/06\/clip_image001_thumb-4.png\" alt=\"clip_image001\" width=\"580\" height=\"632\" border=\"0\" \/><\/a><\/p>\n<p><span style=\"font-size: large;\">\u4ed4\u7ec6\u770b\u8fd9\u4e2a\u56fe\uff0c\u662f\u4e0d\u662f\u975e\u5e38\u7c7b\u4f3cGitFlow\u7684develop\u3001Release\u548cmaster\u5206\u652f\u3002\u4ece\u542b\u4e49\u4e0a\u770b\uff0c\u4ed6\u4eec\u7684\u4f5c\u7528\u975e\u5e38\u7c7b\u4f3c\uff0c\u4f46\u662f\u540d\u5b57\u4e0d\u540c\u3002GitLab Flow\u7684\u547d\u540d\u89c4\u5219\u66f4\u63a5\u8fd1\u4f20\u7edf\u7684\u5f00\u53d1\u8005\u4e60\u60ef\u3002<\/span><\/p>\n<p><span style=\"font-size: large;\"><strong>\u4e8c\u3001Merge\/Pull Request<\/strong><\/span><\/p>\n<p><span style=\"font-size: large;\">CVS\u3001SVN\u7528\u6237\u8868\u793a\u975e\u5e38\u7fa1\u6155\u80fd\u6709\u4e00\u4e9b\u7ba1\u7406\u6027\u5de5\u5177\uff0cGitLab\u7528Merge Request\u4ee3\u66ffPull Request\u8fd8\u662f\u6709\u4e9b\u9053\u7406\u7684\u3002In GitLab it is common to protect the long-lived branches (e.g. the master branch) so that normal developers can&#8217;t modify these protected branches. So if you want to merge it into a protected branch you assign it to someone with maintainer authorizations<\/span><\/p>\n<p><span style=\"font-size: large;\"><strong>\u4e09\u3001Issue Tracking\u548cGitLab Flow<\/strong><\/span><\/p>\n<p><span style=\"font-size: large;\"> In GitLab each change to the codebase starts with an issue in the issue tracking system. If there is no issue yet it should be created first provided there is significant work involved (more than 1 hour). For many organizations this will be natural since the issue will have to be estimated for the sprint. Issue titles should describe the desired state of the system, e.g. &#8220;As an administrator I want to remove users without receiving an error&#8221; instead of &#8220;Admin can&#8217;t remove users.&#8221;.<\/span><\/p>\n<p><span style=\"font-size: large;\">When you are done or want to discuss the code you open a merge request. This is an online place to discuss the change and review the code. Opening a merge request is a manual action since you do not always want to merge a new branch you push, it could be a long-running environment or release branch. If you open the merge request but do not assign it to anyone it is a &#8216;Work In Progress&#8217; merge request. These are used to discuss the proposed implementation but are not ready for inclusion in the master branch yet. Pro tip: Start the title of the merge request with [WIP] or WIP: to prevent it from being merged before it&#8217;s ready.<\/span><\/p>\n<p><a href=\"http:\/\/www.brofive.net\/wp-content\/uploads\/2018\/06\/clip_image002-5.png\"><img loading=\"lazy\" decoding=\"async\" style=\"display: inline; border: 0px;\" title=\"clip_image002\" src=\"http:\/\/www.brofive.net\/wp-content\/uploads\/2018\/06\/clip_image002_thumb-3.png\" alt=\"clip_image002\" width=\"755\" height=\"592\" border=\"0\" \/><\/a><\/p>\n<p><span style=\"font-size: large;\">\u5c0f\u7ed3\uff1a\u770b\u8fc7\u4ee5\u540e\u53ef\u4ee5\u660e\u767d\u4e3a\u4ec0\u4e48Sid\u8bf4GitLab Flow\u6700\u5927\u7684\u7279\u70b9\u662fIssue tracking\u548c\u5f00\u53d1\u96c6\u6210\u4e86\u3002\u56e0\u4e3aGitLab Flow\u7684\u5206\u652f\u548cGitHub Flow\u9887\u6709\u4e9b\u76f8\u4f3c\uff0c\u590d\u6742\u7684GitLab Flow\u548cGitFLow\u4e5f\u6709\u4e9b\u5f62\u4f3c\u3002\u6700\u5927\u7684\u5dee\u5f02\u5f53\u7136\u5c31\u662f\u4ed6\u4eec\u81ea\u5df1\u5f00\u53d1\u7684\u7ba1\u7406\u5de5\u5177\u4e86\u3002<\/span><\/p>\n<p><span style=\"font-size: large;\">\u6bd5\u7adf\uff0c\u65e0\u8bbaGitLab\u8fd8\u662fGitHub\u90fd\u662f\u5728Git\u5916\u9762\u5305\u88c5\u4e86\u4e00\u5957\u7ba1\u7406\u5de5\u5177\uff0c\u5e76\u6ca1\u6709\u8c01\u6bd4\u8c01\u66f4\u9ad8\u660e\u7684\u8bf4\u6cd5\u3002\u800c\u5177\u4f53\u7684\u5206\u652f\u7b56\u7565\uff0c\u4e00\u5b9a\u8981\u548c\u516c\u53f8\u7684\u5f00\u53d1\u6587\u5316\u7ed3\u5408\u5728\u4e00\u8d77\u3002<strong><a href=\"https:\/\/about.gitlab.com\/2017\/09\/27\/gitlab-leader-continuous-integration-forrester-wave\/\">\u9644\u4e0aForrester Wave\u6700\u65b0\u7684CI\u8c61\u9650\u56fe\uff0cGitLab\u662f\u7b2c\u4e00\u540d<\/a><\/strong><\/span><\/p>\n<p><a href=\"http:\/\/www.brofive.net\/wp-content\/uploads\/2018\/06\/clip_image003-4.png\"><img loading=\"lazy\" decoding=\"async\" style=\"display: inline; border: 0px;\" title=\"clip_image003\" src=\"http:\/\/www.brofive.net\/wp-content\/uploads\/2018\/06\/clip_image003_thumb-2.png\" alt=\"clip_image003\" width=\"579\" height=\"568\" border=\"0\" \/><\/a><\/p>\n<p><span style=\"font-size: large;\">\u76f8\u5173\u4fe1\u606f\uff1a<\/span><\/p>\n<p><a href=\"https:\/\/docs.gitlab.com\/ee\/workflow\/gitlab_flow.html\"><span style=\"font-size: large;\">Introduction to GitLab Flow<\/span><\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u611f\u8c22WHS\uff0c\u5173\u6ce8\u4e86\u53e6\u5916\u4e00\u4e2aGit\u98ce\u683c\u7684\u5206\u652f\u7ba1\u7406\u6a21\u578b\uff0cGitLab Flow\u662f2014\u5e74\u7531GitLab\u6b63\u5f0f\u53d1\u5e03\u7684&#8230;<\/p>\n","protected":false},"author":1,"featured_media":2232,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[73,156,237],"tags":[406,408,407,409,414],"views":12549,"_links":{"self":[{"href":"http:\/\/www.brofive.net\/index.php?rest_route=\/wp\/v2\/posts\/2233"}],"collection":[{"href":"http:\/\/www.brofive.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.brofive.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.brofive.net\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.brofive.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2233"}],"version-history":[{"count":4,"href":"http:\/\/www.brofive.net\/index.php?rest_route=\/wp\/v2\/posts\/2233\/revisions"}],"predecessor-version":[{"id":4358,"href":"http:\/\/www.brofive.net\/index.php?rest_route=\/wp\/v2\/posts\/2233\/revisions\/4358"}],"wp:featuredmedia":[{"embeddable":true,"href":"http:\/\/www.brofive.net\/index.php?rest_route=\/wp\/v2\/media\/2232"}],"wp:attachment":[{"href":"http:\/\/www.brofive.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2233"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.brofive.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2233"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.brofive.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2233"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}