{"id":7798,"date":"2014-07-23T23:53:34","date_gmt":"2014-07-23T15:53:34","guid":{"rendered":"http:\/\/ihower.tw\/blog\/?p=7798"},"modified":"2014-07-24T09:02:16","modified_gmt":"2014-07-24T01:02:16","slug":"git-%e9%96%8b%e7%99%bc%e6%b5%81%e7%a8%8b%e7%9a%84%e6%bc%94%e9%80%b2","status":"publish","type":"post","link":"https:\/\/ihower.tw\/blog\/7798-git-%e9%96%8b%e7%99%bc%e6%b5%81%e7%a8%8b%e7%9a%84%e6%bc%94%e9%80%b2","title":{"rendered":"\u8ac7 Git \u7684\u958b\u767c\u6d41\u7a0b"},"content":{"rendered":"<p>\u5f88\u9ad8\u8208\u53d7\u9080\u53c3\u52a0<a href=\"http:\/\/youmeb.kktix.cc\/events\/f2e10\">\u300eFED Party 10\u300fGIT\u7684develop\u8207master<\/a> \u8ad6\u58c7\u6210\u70ba\u8207\u8ac7\u4eba\u3002\u5176\u4e2d\u300c\u5354\u540c\u958b\u767c\u6642\uff0cmaster \u8207 dev branch \u5982\u4f55\u898f\u5283?\u300d\u9019\u500b\u554f\u984c\u662f\u6211\u4e3b\u8981\u8b1b\u8ff0\u7684\u90e8\u4efd\uff0c\u5206\u4eab\u4e86\u5718\u968a\u7528 Git \u7684\u958b\u767c\u6d41\u7a0b\u7d93\u9a57\u3002<\/p>\n<p>2010 \u5e74\u7684 <a href=\"http:\/\/ihower.tw\/blog\/archives\/5140\">GitFlow<\/a> \u662f\u4e00\u500b\u5f88\u597d\u7684\u958b\u59cb\uff0c\u5b83\u63d0\u4f9b\u4e86\u4e00\u500b\u5f88\u6e05\u695a\u7684\u958b\u767c\u6d41\u7a0b\uff0c\u5e7e\u4e4e\u53ef\u8aaa\u662f\u76ee\u524d\u7528 Git \u7684\u300c\u6a19\u6e96\u958b\u767c\u6d41\u7a0b\u300d\u3002\u4e0d\u904e\u6d41\u7a0b\u7684\u76ee\u7684\u662f\u70ba\u4e86\u5e6b\u52a9\u8edf\u9ad4\u958b\u767c\u548c\u91cb\u51fa\uff0c\u800c\u4e0d\u540c\u5718\u968a\u6709\u8457\u4e0d\u540c\u7684\u9700\u6c42\uff0c\u4e5f\u5c31\u4e0d\u53ef\u80fd\u6709 &#8220;One size fits all &#8221; \u7684\u89e3\u6cd5\u3002<\/p>\n<p>\u6487\u958b Gitflow \u6bd4\u8f03\u56c9\u5506(\u6216\u8005\u4f60\u8981\u8aaa\u5b83\u6bd4\u8f03\u56b4\u8b39?)\u7684\u6d41\u7a0b\uff0c\u6211\u8a8d\u70ba\u6700\u5927\u7684\u554f\u984c(\u6216\u5929\u6027)\u662f\u5b83\u6bd4\u8f03\u9069\u5408\u642d\u914d Iteration-based \u6d41\u7a0b(\u4e00\u6279\u529f\u80fd\u5b8c\u6210\u624d\u9032\u884c\u91cb\u51fa\u3001\u9031\u671f\u6027\u4f48\u7f72)\uff0c\u800c\u4e0d\u662f Kanban \u6d41\u7a0b (\u4e00\u500b\u529f\u80fd\u5b8c\u6210\u5c31\u9032\u884c\u91cb\u51fa\u3001\u6bcf\u5929\u591a\u6b21\u4f48\u7f72)\u3002\u600e\u9ebc\u8aaa\u5462?<\/p>\n<p>\u5047\u8a2d\u5718\u968a\u9019\u6b21 iteration \u540c\u6642\u5728\u958b\u767c A,B,C \u4e09\u500b features\u3002\u5728 GitFlow \u4e4b\u4e2d\uff0c\u6211\u5011\u901a\u5e38\u4e0d\u6703\u4e00\u500b feature \u5beb\u597d\u5c31\u958b release branch\uff0c\u800c\u662f\u6703\u7b49\u5230 A,B,C \u90fd\u5b8c\u6210\u4e86\uff0c\u5728\u4e00\u8d77\u958b release branch \u8dd1 CI \u4e0a staging server \u4e00\u8d77\u6e2c\u8a66\u3002\u9019\u6642\u5019\u554f\u984c\u5c31\u4f86\u4e86\uff0c\u5982\u679c feature A \u6e2c\u8a66\u6709\u554f\u984c\uff0c\u5373\u4f7f B,C \u6c92\u554f\u984c\uff0c\u6574\u500b release branch \u4e5f\u6703\u5361\u4f4f\u7121\u6cd5\u91cb\u51fa\u3002\u9019\u4e00\u5361\u53ef\u80fd\u53c8\u62d6\u4e86\u597d\u5e7e\u5929&#8230;<\/p>\n<p>\u7406\u60f3\u7684 Kanban \u6d41\u7a0b\u6703\u5e0c\u671b\u4e00\u500b feature \u5b8c\u6210\u5c31\u80fd\u63a8\u4e0a production \u91cb\u51fa\u3002\u9019\u6642\u5019  release branch \u7684\u8a2d\u8a08\u5c31\u986f\u5f97\u7919\u624b\u7919\u8173\u4e86\u3002\u90a3\u8981\u600e\u9ebc\u9054\u5230\u4e00\u500b feature \u53ef\u4ee5\u55ae\u7368\u91cb\u51fa\u5462? \u9996\u5148\u4f60\u6703\u9700\u8981\u591a\u91cd CI \u548c staging servers \u7684\u74b0\u5883\u3002\u6bcf\u65b0\u958b\u4e00\u500b feature branch \u5c31\u6703\u6709\u5404\u81ea\u5c0d\u61c9\u7684 CI \u548c staging server \u53ef\u4ee5\u9032\u884c\u6e2c\u8a66\uff0c\u9019\u6a23\u53ea\u8981\u8a72 feature branch \u6e2c\u8a66\u5b8c\u6210\uff0c\u5c31\u4ee3\u8868\u53ef\u4ee5\u5408\u4f75\u56de\u4e3b\u5e79\u9032\u884c\u91cb\u51fa\u52d5\u4f5c\u3002\u8a71\u8aaa\u56de\u4f86\uff0c\u9019\u5176\u5be6\u5c31\u662f <a href=\"http:\/\/scottchacon.com\/2011\/08\/31\/github-flow.html\">GitHub Flow<\/a> \u6d41\u7a0b\u3002<\/p>\n<p>\u5be6\u52d9\u4e0a\uff0c\u4f60\u4e5f\u53ef\u4ee5\u9810\u5148\u958b\u597d\u6578\u53f0 staging \u6a5f\u5668\uff0c\u7136\u5f8c\u8b93\u958b\u767c\u8005\u53ef\u4ee5\u4f48\u7f72 feature branch \u4e0a\u53bb\u9032\u884cQA\u6e2c\u8a66\u3002\u9019\u6a23\u5c31\u4e0d\u9700\u8981\u8fa6\u5230\u96a8\u6642\u52d5\u614b\u958b staging \u6a5f\u5668\u7684\u6280\u8853\u80fd\u529b\u3002<\/p>\n<p>\u5982\u679c staging \u6a5f\u5668\u771f\u7684\u6709\u9650\u5236\u53ea\u80fd\u958b\u4e00\u53f0\uff0c\u53e6\u4e00\u500b\u8b8a\u5f62\u4f5c\u6cd5\u662f\u6709\u4e00\u500b\u5c08\u9580\u7684 staging branch\uff0c\u9700\u8981\u4e0a staging \u6a5f\u5668\u9032\u884c\u6e2c\u8a66\u7684 feature branch \u5c31\u5408\u4f75\u9032 staging branch \u9032\u884c\u4f48\u7f72\u3002\u4f46\u662f\u6ce8\u610f\u5230\u9019\u500b staging branch \u4e26\u4e0d\u6703\u5408\u4f75\u56de\u4e3b\u5e79\uff0c\u5b83\u662f\u6c38\u9060\u5e73\u884c\u7684\u3002\u4e5f\u5c31\u662f\u8aaa staging branch \u4e0a\u53ef\u80fd\u5305\u542b A,B,C feature branchs\uff0c\u7576 feature B \u5728 staging \u4e0a\u6e2c\u8a66\u5b8c\u6210\uff0c\u5c31\u5408\u4f75 feature B branch \u56de\u4e3b\u5e79\uff0c\u800c\u4e0d\u662f staging branch\u3002\u9019\u7b97\u662f\u4e00\u500b workaround \u7684\u4f5c\u6cd5\uff0c\u6211\u5011\u516c\u53f8\u5c31\u6709\u5718\u968a\u5c31\u63a1\u7528\u9019\u500b\u4f5c\u6cd5\uff0c\u4e5f\u975e\u5e38\u5be6\u7528\u3002<\/p>\n<p>\u7e3d\u4e4b\uff0c\u7121\u8ad6\u63a1\u7528\u4f55\u7a2e\u6d41\u7a0b\uff0c\u6211\u7684\u91cd\u9ede\u5728\u65bc\u5fc5\u9808\u4e00\u4f75\u8003\u616e\u5982\u4f55\u642d\u914d CI\u3001Code Review\u3001\u624b\u52d5 QA \u6e2c\u8a66\u7b49\u7b49\u6574\u5957\u8edf\u9ad4\u91cb\u51fa\u6d41\u7a0b\uff0c\u624d\u662f\u901a\u76e4\u7684\u8003\u91cf\u3002<\/p>\n<h3>\u53c3\u8003\u8cc7\u6599<\/h3>\n<ul>\n<li><a href=\"http:\/\/blog.endpoint.com\/2014\/05\/git-workflows-that-work.html\">Git Workflows That Work<\/a><\/li>\n<li><a href=\"http:\/\/scottchacon.com\/2011\/08\/31\/github-flow.html\">GitHub Flow<\/a><\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>\u5f88\u9ad8\u8208\u53d7\u9080\u53c3\u52a0\u300eFED Party 10\u300fGIT\u7684develop\u8207master \u8ad6\u58c7\u6210\u70ba\u8207\u8ac7\u4eba\u3002\u5176\u4e2d\u300c\u5354\u540c\u958b\u767c &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/ihower.tw\/blog\/7798-git-%e9%96%8b%e7%99%bc%e6%b5%81%e7%a8%8b%e7%9a%84%e6%bc%94%e9%80%b2\" class=\"more-link\">\u95b1\u8b80\u5168\u6587<span class=\"screen-reader-text\">\u3008\u8ac7 Git \u7684\u958b\u767c\u6d41\u7a0b\u3009<\/span><\/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,"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[48],"tags":[],"class_list":["post-7798","post","type-post","status-publish","format-standard","hentry","category-git","entry"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/p1q6tG-21M","jetpack_sharing_enabled":true,"jetpack_likes_enabled":true,"_links":{"self":[{"href":"https:\/\/ihower.tw\/blog\/wp-json\/wp\/v2\/posts\/7798","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ihower.tw\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ihower.tw\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ihower.tw\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ihower.tw\/blog\/wp-json\/wp\/v2\/comments?post=7798"}],"version-history":[{"count":30,"href":"https:\/\/ihower.tw\/blog\/wp-json\/wp\/v2\/posts\/7798\/revisions"}],"predecessor-version":[{"id":7832,"href":"https:\/\/ihower.tw\/blog\/wp-json\/wp\/v2\/posts\/7798\/revisions\/7832"}],"wp:attachment":[{"href":"https:\/\/ihower.tw\/blog\/wp-json\/wp\/v2\/media?parent=7798"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ihower.tw\/blog\/wp-json\/wp\/v2\/categories?post=7798"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ihower.tw\/blog\/wp-json\/wp\/v2\/tags?post=7798"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}