{"id":21551,"date":"2024-11-19T13:28:27","date_gmt":"2024-11-19T05:28:27","guid":{"rendered":"https:\/\/fwq.ai\/blog\/21551\/"},"modified":"2024-11-19T13:28:27","modified_gmt":"2024-11-19T05:28:27","slug":"git%e6%80%8e%e4%b9%88%e5%88%86%e5%bc%80commit","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/21551\/","title":{"rendered":"git\u600e\u4e48\u5206\u5f00commit"},"content":{"rendered":"<blockquote><p>\n  \u4f7f\u7528 git \u53ef\u4ee5\u5206\u5f00\u63d0\u4ea4\u4ee3\u7801\uff0c\u63d0\u4f9b\u7cbe\u7ec6\u7684\u53d8\u66f4\u8ffd\u8e2a\u548c\u72ec\u7acb\u7684\u5de5\u4f5c\u80fd\u529b\u3002\u6b65\u9aa4\u5982\u4e0b\uff1a 1. \u6dfb\u52a0\u5df2\u66f4\u6539\u7684\u6587\u4ef6\uff1b 2. \u63d0\u4ea4\u7279\u5b9a\u66f4\u6539\uff1b 3. \u91cd\u590d\u4e0a\u8ff0\u6b65\u9aa4\uff1b 4. \u63a8\u9001\u63d0\u4ea4\u5230\u8fdc\u7a0b\u4ed3\u5e93\u3002\n<\/p><\/blockquote>\n<p><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/202405\/30\/2024053023514224448.jpg\" class=\"aligncenter\" title=\"git\u600e\u4e48\u5206\u5f00commit\u63d2\u56fe\" alt=\"git\u600e\u4e48\u5206\u5f00commit\u63d2\u56fe\" \/><\/p>\n<p><strong>\u5982\u4f55\u5206\u5f00\u63d0\u4ea4\u4ee3\u7801<\/strong><\/p>\n<p><strong>\u5206\u5f00\u63d0\u4ea4\u7684\u7406\u7531<\/strong><\/p>\n<p> \u662f\u4e00\u4e2a\u5206\u5e03\u5f0f\u7248\u672c\u63a7\u5236\u7cfb\u7edf\uff0c\u5b83\u5141\u8bb8\u7528\u6237\u5728\u4e0d\u5f71\u54cd\u5176\u4ed6\u56e2\u961f\u6210\u5458\u5de5\u4f5c\u7684\u60c5\u51b5\u4e0b\uff0c\u72ec\u7acb\u5de5\u4f5c\u5e76\u63d0\u4ea4\u4ee3\u7801\u3002\u5206\u5f00\u63d0\u4ea4\u4ee3\u7801\u53ef\u4ee5\u63d0\u4f9b\u4ee5\u4e0b\u597d\u5904\uff1a<\/p>\n<ul>\n<li>\u8ffd\u8e2a\u548c\u7ba1\u7406\u4ee3\u7801\u53d8\u66f4\u7684\u7c92\u5ea6\u63a7\u5236\u3002<\/li>\n<li>\u5728\u63d0\u4ea4\u4e4b\u524d\u6d4b\u8bd5\u548c\u9a8c\u8bc1\u7279\u5b9a\u53d8\u66f4\u3002<\/li>\n<li>\u5141\u8bb8\u56e2\u961f\u6210\u5458\u534f\u4f5c\u5f00\u53d1\u4e0d\u540c\u529f\u80fd\uff0c\u800c\u4e0d\u4f1a\u76f8\u4e92\u51b2\u7a81\u3002<\/li>\n<\/ul>\n<p><strong>\u5728 git \u4e2d\u5206\u5f00\u63d0\u4ea4\u7684\u6b65\u9aa4<\/strong><\/p>\n<p>\u8981\u5206\u5f00\u63d0\u4ea4\u4ee3\u7801\uff0c\u8bf7\u6309\u7167\u4ee5\u4e0b\u6b65\u9aa4\u64cd\u4f5c\uff1a<\/p>\n<ol>\n<li> <strong>\u5bf9\u4f60\u7684\u4ee3\u7801\u8fdb\u884c\u53d8\u66f4<\/strong>\u3002<\/li>\n<li> <strong>\u4f7f\u7528 git add \u547d\u4ee4\u6dfb\u52a0\u5df2\u66f4\u6539\u7684\u6587\u4ef6<\/strong>\u3002\u8be5\u547d\u4ee4\u5c06\u6682\u5b58\u66f4\u6539\uff0c\u4f46\u4e0d\u63d0\u4ea4\u5b83\u4eec\u3002<\/li>\n<li> <strong>\u4f7f\u7528 git commit -m &#8220;\u6d88\u606f&#8221; \u547d\u4ee4\u63d0\u4ea4\u7279\u5b9a\u7684\u66f4\u6539<\/strong>\u3002\u6b64\u547d\u4ee4\u5c06\u521b\u5efa\u65b0\u7684\u63d0\u4ea4\uff0c\u5305\u542b\u6682\u5b58\u7684\u66f4\u6539\u3002<\/li>\n<li> <strong>\u91cd\u590d\u6b65\u9aa4 2 \u548c 3\uff0c\u4ee5\u63d0\u4ea4\u989d\u5916\u7684\u66f4\u6539<\/strong>\u3002<\/li>\n<li> <strong>\u4f7f\u7528 git push \u547d\u4ee4\u5c06\u63d0\u4ea4\u63a8\u9001\u5230\u8fdc\u7a0b\u4ed3\u5e93<\/strong>\u3002<\/li>\n<\/ol>\n<p><strong>\u793a\u4f8b<\/strong><\/p>\n<p>\u5047\u8bbe\u4f60\u8981\u5f00\u53d1\u4e00\u4e2a\u65b0\u7684\u529f\u80fd\uff0c\u5e76\u5e0c\u671b\u5c06\u5176\u5206\u4e3a\u591a\u4e2a\u63d0\u4ea4\u3002\u4f60\u53ef\u4ee5\u6309\u7167\u4ee5\u4e0b\u6b65\u9aa4\u64cd\u4f5c\uff1a<\/p>\n<ol>\n<li>\u521b\u5efa\u4e00\u4e2a\u65b0\u7684\u5206\u652f\u6765\u5f00\u53d1\u8be5\u529f\u80fd\u3002<\/li>\n<li>\u5b9e\u73b0\u529f\u80fd\u7684\u7b2c\u4e00\u90e8\u5206\uff0c\u5e76\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u63d0\u4ea4\u5b83\uff1a<\/li>\n<\/ol>\n<pre>git add .\ngit commit -m \"\u5b9e\u73b0\u529f\u80fd\u7684\u7b2c\u4e00\u90e8\u5206\"<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<ol>\n<li>\u5b9e\u73b0\u529f\u80fd\u7684\u7b2c\u4e8c\u90e8\u5206\uff0c\u5e76\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u63d0\u4ea4\u5b83\uff1a<\/li>\n<\/ol>\n<pre>git add .\ngit commit -m \"\u5b9e\u73b0\u529f\u80fd\u7684\u7b2c\u4e8c\u90e8\u5206\"<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<ol>\n<li>\u91cd\u590d\u6b65\u9aa4 3 \u4ee5\u63d0\u4ea4\u4efb\u4f55\u5176\u4ed6\u5fc5\u8981\u7684\u66f4\u6539\u3002<\/li>\n<li>\u5b8c\u6210\u529f\u80fd\u5f00\u53d1\u540e\uff0c\u5408\u5e76\u5206\u652f\u5e76\u63a8\u9001\u63d0\u4ea4\u3002<\/li>\n<\/ol>\n<p><strong>\u63d0\u793a<\/strong><\/p>\n<ul>\n<li>\u4f7f\u7528\u6709\u610f\u4e49\u7684\u63d0\u4ea4\u6d88\u606f\uff0c\u4ee5\u6e05\u695a\u5730\u63cf\u8ff0\u6bcf\u4e2a\u63d0\u4ea4\u7684\u53d8\u66f4\u3002<\/li>\n<li>\u5b9a\u671f\u4f7f\u7528 git status \u547d\u4ee4\u6765\u68c0\u67e5\u672a\u63d0\u4ea4\u7684\u66f4\u6539\u3002<\/li>\n<li>\u5728\u5f00\u59cb\u65b0\u4efb\u52a1\u4e4b\u524d\uff0c\u8003\u8651\u521b\u5efa\u4e00\u4e2a\u65b0\u7684\u5206\u652f\uff0c\u4ee5\u907f\u514d\u53d1\u751f\u51b2\u7a81\u3002<\/li>\n<\/ul>\n<p>\u4ee5\u4e0a\u5c31\u662f\u600e\u4e48\u5206\u5f00commit\u7684\u8be6\u7ec6\u5185\u5bb9\uff0c\u66f4\u591a\u8bf7\u5173\u6ce8\u7c73\u4e91\u5176\u5b83\u76f8\u5173\u6587\u7ae0\uff01<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u4f7f\u7528 git \u53ef\u4ee5\u5206\u5f00\u63d0\u4ea4\u4ee3\u7801\uff0c\u63d0\u4f9b\u7cbe\u7ec6\u7684\u53d8\u66f4\u8ffd\u8e2a\u548c\u72ec\u7acb\u7684\u5de5\u4f5c\u80fd\u529b\u3002\u6b65\u9aa4\u5982\u4e0b\uff1a 1. \u6dfb\u52a0\u5df2\u66f4\u6539\u7684\u6587\u4ef6\uff1b 2. \u63d0\u4ea4\u7279\u5b9a\u66f4\u6539\uff1b 3. \u91cd\u590d\u4e0a\u8ff0\u6b65\u9aa4\uff1b 4. \u63a8\u9001\u63d0\u4ea4\u5230\u8fdc\u7a0b\u4ed3\u5e93\u3002 \u5982\u4f55\u5206\u5f00\u63d0\u4ea4\u4ee3\u7801 \u5206\u5f00\u63d0\u4ea4\u7684\u7406\u7531 \u662f\u4e00\u4e2a\u5206\u5e03\u5f0f\u7248\u672c\u63a7\u5236\u7cfb\u7edf\uff0c\u5b83\u5141\u8bb8\u7528\u6237\u5728\u4e0d\u5f71\u54cd\u5176\u4ed6\u56e2\u961f\u6210\u5458\u5de5\u4f5c\u7684\u60c5\u51b5\u4e0b\uff0c\u72ec\u7acb\u5de5\u4f5c\u5e76\u63d0\u4ea4\u4ee3\u7801\u3002\u5206\u5f00\u63d0\u4ea4\u4ee3\u7801\u53ef\u4ee5\u63d0\u4f9b\u4ee5\u4e0b\u597d\u5904\uff1a \u8ffd\u8e2a\u548c\u7ba1\u7406\u4ee3\u7801\u53d8\u66f4\u7684\u7c92\u5ea6\u63a7\u5236\u3002 \u5728\u63d0\u4ea4\u4e4b\u524d\u6d4b\u8bd5\u548c\u9a8c\u8bc1\u7279\u5b9a\u53d8\u66f4\u3002 \u5141\u8bb8\u56e2\u961f\u6210\u5458\u534f\u4f5c\u5f00\u53d1\u4e0d\u540c\u529f\u80fd\uff0c\u800c\u4e0d\u4f1a\u76f8\u4e92\u51b2\u7a81\u3002 \u5728 git \u4e2d\u5206\u5f00\u63d0\u4ea4\u7684\u6b65\u9aa4 \u8981\u5206\u5f00\u63d0\u4ea4\u4ee3\u7801\uff0c\u8bf7\u6309\u7167\u4ee5\u4e0b\u6b65\u9aa4\u64cd\u4f5c\uff1a \u5bf9\u4f60\u7684\u4ee3\u7801\u8fdb\u884c\u53d8\u66f4\u3002 \u4f7f\u7528 git add \u547d\u4ee4\u6dfb\u52a0\u5df2\u66f4\u6539\u7684\u6587\u4ef6\u3002\u8be5\u547d\u4ee4\u5c06\u6682\u5b58\u66f4\u6539\uff0c\u4f46\u4e0d\u63d0\u4ea4\u5b83\u4eec\u3002 \u4f7f\u7528 git commit -m &#8220;\u6d88\u606f&#8221; \u547d\u4ee4\u63d0\u4ea4\u7279\u5b9a\u7684\u66f4\u6539\u3002\u6b64\u547d\u4ee4\u5c06\u521b\u5efa\u65b0\u7684\u63d0\u4ea4\uff0c\u5305\u542b\u6682\u5b58\u7684\u66f4\u6539\u3002 \u91cd\u590d\u6b65\u9aa4 2 \u548c 3\uff0c\u4ee5\u63d0\u4ea4\u989d\u5916\u7684\u66f4\u6539\u3002 \u4f7f\u7528 git push \u547d\u4ee4\u5c06\u63d0\u4ea4\u63a8\u9001\u5230\u8fdc\u7a0b\u4ed3\u5e93\u3002 \u793a\u4f8b \u5047\u8bbe\u4f60\u8981\u5f00\u53d1\u4e00\u4e2a\u65b0\u7684\u529f\u80fd\uff0c\u5e76\u5e0c\u671b\u5c06\u5176\u5206\u4e3a\u591a\u4e2a\u63d0\u4ea4\u3002\u4f60\u53ef\u4ee5\u6309\u7167\u4ee5\u4e0b\u6b65\u9aa4\u64cd\u4f5c\uff1a \u521b\u5efa\u4e00\u4e2a\u65b0\u7684\u5206\u652f\u6765\u5f00\u53d1\u8be5\u529f\u80fd\u3002 \u5b9e\u73b0\u529f\u80fd\u7684\u7b2c\u4e00\u90e8\u5206\uff0c\u5e76\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u63d0\u4ea4\u5b83\uff1a git add . git commit -m &#8220;\u5b9e\u73b0\u529f\u80fd\u7684\u7b2c\u4e00\u90e8\u5206&#8221; \u767b\u5f55\u540e\u590d\u5236 \u5b9e\u73b0\u529f\u80fd\u7684\u7b2c\u4e8c\u90e8\u5206\uff0c\u5e76\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u63d0\u4ea4\u5b83\uff1a git add [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[16],"tags":[],"class_list":["post-21551","post","type-post","status-publish","format-standard","hentry","category-16"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/21551","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/comments?post=21551"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/21551\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=21551"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=21551"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=21551"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}