{"id":1175,"date":"2022-06-30T18:18:25","date_gmt":"2022-06-30T10:18:25","guid":{"rendered":"https:\/\/www.mustenaka.cn\/?p=1175"},"modified":"2022-06-30T18:18:25","modified_gmt":"2022-06-30T10:18:25","slug":"git-commit-standard","status":"publish","type":"post","link":"https:\/\/www.mustenaka.cn\/index.php\/2022\/06\/30\/git-commit-standard\/","title":{"rendered":"Git Commit\u89c4\u8303"},"content":{"rendered":"<h1>\u5404\u79cd\u9879\u76ee\u89c4\u8303<\/h1>\n<blockquote><p>\u64b0\u5199\u4eba\uff1aAndrew<\/p>\n<p>\u65f6\u95f4\uff1a2022.06.30<\/p><\/blockquote>\n<h2>Git \u63d0\u4ea4\u89c4\u8303<\/h2>\n<p>\u6bcf\u4e00\u6b21\u4ee3\u7801\u63d0\u4ea4commit\uff0c\u9700\u8981\u6309\u7167<\/p>\n<blockquote><p>[type] $(scope): subject<br \/>\n[\u63cf\u8ff0\u7c7b\u578b] $(\u5f71\u54cd\u8303\u56f4): \u63cf\u8ff0<\/p><\/blockquote>\n<p>\u5982\uff1a<\/p>\n<blockquote><p>&#8211; [fix] $(fileName): add a function to fix bug.<br \/>\n&#8211; [add] $(fileArea): add a package for calculate the sum.<br \/>\n&#8211; [\u4fee\u6539] \u4fee\u590d\u4e86\u7528\u6237\u5934\u50cf\u5c55\u793a\u9519\u8bef\u7684bug<\/p>\n<p>-[\u6587\u6863] $(Readme.md) \u65b0\u589e\u4e86\u5173\u4e8e\u9879\u76ee\u7684\u7ec6\u8282\u63cf\u8ff0<\/p><\/blockquote>\n<p>\u4e2d\u82f1\u6587\u7686\u53ef<\/p>\n<h4>Type\uff08\u5fc5\u987b\uff09\uff1acommit\u7684\u7c7b\u522b\uff0c\u5141\u8bb8\u4f7f\u7528\u5982\u4e0b\u8868\u793a<\/h4>\n<ul>\n<li>feat: \u65b0\u529f\u80fd\uff08\u53ef\u4ee5add\/\u6dfb\u52a0\uff09<\/li>\n<li>fix: \u4fee\u590dbug<\/li>\n<li>docs: \u6587\u6863\u6539\u53d8<\/li>\n<li>style:\u4ee3\u7801\u683c\u5f0f\u6539\u53d8<\/li>\n<li>refactor: \u91cd\u6784<\/li>\n<li>perf: \u6027\u80fd\u4f18\u5316<\/li>\n<li>test: \u589e\u52a0\u6d4b\u8bd5<\/li>\n<li>build: \u4fee\u6539\u4e86build\u5de5\u5177\uff0c\u6216\u8005build\u76f8\u5173\u6587\u4ef6<\/li>\n<li>revert: \u64a4\u9500commit<\/li>\n<\/ul>\n<p>\u6709\u4e00\u4e2a\u7279\u4f8b\uff0c\u4fee\u6539\u7248\u672c\u53f7\u65f6\uff0c\u53ef\u4ee5\u4f7f\u7528update to version=vX.X.X\u8fd9\u6837\u7684\u63cf\u8ff0<\/p>\n<h4>Scope\uff08\u53ef\u9009\uff09\uff1acommit\u7684\u5f71\u54cd\u8303\u56f4<\/h4>\n<p>\u7528\u4e8e\u8bf4\u660ecommit\u5f71\u54cd\u7684\u8303\u56f4\uff0c\u5982\u6570\u636e\u5c42\u3001\u63a7\u5236\u5c42\u3001\u89c6\u56fe\u5c42\u3001\u6216\u8005\u67d0\u4e00\u4e2a\u5355\u72ec\u7684\u6587\u4ef6\uff0c\u89c6\u9879\u76ee\u4e0d\u540c\u800c\u4e0d\u540c\uff0c\u6ce8\u610f\u6211\u53f8\u4e2d\u4e0d\u5e38\u7279\u6b8a\u63cf\u8ff0\uff0c\u5c3d\u91cf\u91c7\u53d6\u5355\u4e00commit\u3002<\/p>\n<p>&gt; \u5373\uff1a\u4e00\u6b21\u63d0\u4ea4\u5c3d\u91cf\u53ea\u8bf4\u660e\u4e00\u4e2a\u5185\u5bb9\u7684\u4fee\u6539\uff0c\u5728\u4ee3\u7801\u67b6\u6784\u3001\u6587\u4ef6\u5e03\u5c40\u4e2d\u5c3d\u91cf\u505a\u5230\u89e3\u8026\uff0c\u8fd9\u6837\u4e00\u6b21\u63d0\u4ea4\u5c31\u53ea\u9700\u8981\u5f71\u54cd\u6781\u5c11\u6570\u7684\u4ee3\u7801\u6587\u4ef6\uff0c\u6545scope\u53ef\u4ee5\u7701\u7565\u3002<\/p>\n<h4>subject\uff08\u5fc5\u987b\uff09\uff1acommit\u7684\u7b80\u77ed\u63cf\u8ff0\uff0c\u4e00\u822c\u4e0d\u8d85\u8fc750\u5b57\u7b26<\/h4>\n<p>\u65e0\u8bba\u4e2d\u82f1\u6587\u90fd\u5c3d\u91cf\u8a00\u7b80\u610f\u8d45\u3002<\/p>\n<p>\u82f1\u6587\u63d0\u4ea4\u89c4\u8303\uff1a<\/p>\n<p>1. use imperative(\u547d\u4ee4\u5f0f), present tense: \u201cchange\u201d not \u201cchanged\u201d nor \u201cchanges\u201d<br \/>\n2. don&#8217;t capitalize first letter<br \/>\n3. no dot (.) at the end<\/p>\n<h4>\u5907\u6ce8<\/h4>\n<p>\u4e0d\u8981\u5acc\u9ebb\u70e6\u548c\u5f3a\u8feb\u75c7\uff0c\u5982\u679c\u4e00\u4e2a\u6a21\u5757commit\u4e4b\u540e\u53d1\u73b0\u4e00\u4e2a\u63cf\u8ff0\u6216\u8005\u7b80\u5355\u7684\u51e0\u4e2a\u5b57\u7b26\u9700\u8981\u91cd\u5199\uff0c\u90a3\u4e48\u4e0d\u8981\u541d\u556ccommit\uff0c\u518dcommit -m &#8220;[\u4fee\u6539]\u4fee\u6539\u4e86\u4e00\u4e2alog\u63cf\u8ff0&#8221;<\/p>\n<h2>\u66f4\u65b0\u89c4\u8303<\/h2>\n<p>\u6bcf\u4e00\u4e2a\u9879\u76ee\u90fd\u9700\u8981\u786e\u7acb\u7248\u672c\uff0c\u4ee5\u7b26\u53f7v\u5f00\u5934\uff0c\u7c7b\u578b\u4e3a **v[\u5927\u7248\u672c].[\u5c0f\u7248\u672c].[\u529f\u80fd\u903b\u8f91\u4f18\u5316\u7248\u672c]** \u5982v1.2.3<\/p>\n<p>\u6bcf\u4e00\u6b21\u66f4\u65b0\uff0c\u9700\u8981\u518d\u9879\u76ee\u4e2d\u90e8\u7f72\u5b58\u653e **docs\/updateDocument.md**\uff08\u540d\u5b57\u53ef\u4ee5\u4efb\u53d6\uff0c\u4e2d\u82f1\u4ea6\u53ef\uff09\uff0c\u5bf9\u6bcf\u4e00\u4e2a\u66f4\u65b0\u8fdb\u884c\u8bb0\u5f55\uff0c\u6bcf\u4e00\u4e2a\u529f\u80fd\u903b\u8f91\u4f18\u5316\u7248\u672c\u66f4\u65b0\u90fd\u9700\u8981\u518d\u4e3b\u7ebfmerage\u5230dev\u6216\u8005\u662fmain\u7248\u672c\u4e2d\uff0c\u5982\u679c\u9700\u8981\uff0c\u53ef\u4ee5\u5728\u6bcf\u4e00\u4e2a\u5c0f\u7248\u672c\u66f4\u65b0\u65f6\u5bfc\u51faPakcage\uff0c\u5e76\u653e\u7f6e\u4e8eGit\u4ed3\u5e93release\u3002<\/p>\n<p>\u4f8b\uff1a<\/p>\n<blockquote>\n<h3>v0.1.7 | 2022\/06\/30 &#8211; 2022\/07\/01<\/h3>\n<p>&#8211; [\u65b0\u589e] index\u9875\u9762\u73b0\u5728\u5c3e\u90e8\u4f1a\u663e\u793aapp\u7248\u672c\u53f7<\/p><\/blockquote>\n<h2>\u6587\u4ef6\u5e03\u5c40<\/h2>\n<p>\u4e0d\u505a\u5f3a\u5236\u5b89\u6392\uff0c\u4ee5\u8be5\u9879\u76ee\u7684\u8bed\u8a00\u4e3a\u51c6\u3002<\/p>\n<p>\u4f46\u662f\u9700\u8981\u4fdd\u8bc1\u6bcf\u4e00\u4e2a\u9879\u76ee\u65b0\u5efa\u90fd\u8981\u4fdd\u5b58README.md\u4ee5\u53cadoc\/\u66f4\u65b0\u8bb0\u5f55.md\u4e24\u4e2a\u6587\u4ef6\uff0c\u4e0d\u5f00\u6e90\u9009\u62e9\u79c1\u6709\uff0c\u5f00\u6e90\u9009\u62e9MIT\u534f\u8bae\uff0c\u5e76\u4e14\u9700\u8981\u6309\u7167\u6807\u6ce8\u89c4\u5219\u8bbe\u7f6egitignore\u6587\u4ef6\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5404\u79cd\u9879\u76ee\u89c4\u8303 \u64b0\u5199\u4eba\uff1aAndrew \u65f6\u95f4\uff1a2022.06.30 Git \u63d0\u4ea4\u89c4\u8303 \u6bcf\u4e00\u6b21\u4ee3\u7801\u63d0\u4ea4co [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[85,97],"tags":[38],"class_list":["post-1175","post","type-post","status-publish","format-standard","hentry","category-git","category-essay","tag-git"],"views":756,"_links":{"self":[{"href":"https:\/\/www.mustenaka.cn\/index.php\/wp-json\/wp\/v2\/posts\/1175","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.mustenaka.cn\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.mustenaka.cn\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.mustenaka.cn\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.mustenaka.cn\/index.php\/wp-json\/wp\/v2\/comments?post=1175"}],"version-history":[{"count":1,"href":"https:\/\/www.mustenaka.cn\/index.php\/wp-json\/wp\/v2\/posts\/1175\/revisions"}],"predecessor-version":[{"id":1176,"href":"https:\/\/www.mustenaka.cn\/index.php\/wp-json\/wp\/v2\/posts\/1175\/revisions\/1176"}],"wp:attachment":[{"href":"https:\/\/www.mustenaka.cn\/index.php\/wp-json\/wp\/v2\/media?parent=1175"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.mustenaka.cn\/index.php\/wp-json\/wp\/v2\/categories?post=1175"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.mustenaka.cn\/index.php\/wp-json\/wp\/v2\/tags?post=1175"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}