{"id":21198,"date":"2024-11-19T12:54:57","date_gmt":"2024-11-19T04:54:57","guid":{"rendered":"https:\/\/fwq.ai\/blog\/21198\/"},"modified":"2024-11-19T12:54:57","modified_gmt":"2024-11-19T04:54:57","slug":"git%e5%91%bd%e4%bb%a4%e6%8f%90%e4%ba%a4%e6%8c%87%e5%ae%9a%e6%96%87%e4%bb%b6%e6%80%8e%e4%b9%88%e6%93%8d%e4%bd%9c","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/21198\/","title":{"rendered":"git\u547d\u4ee4\u63d0\u4ea4\u6307\u5b9a\u6587\u4ef6\u600e\u4e48\u64cd\u4f5c"},"content":{"rendered":"<blockquote><p>\n  \u5982\u4f55\u5728 git \u4e2d\u63d0\u4ea4\u6307\u5b9a\u6587\u4ef6\uff1f\u5c06\u6587\u4ef6\u6682\u5b58\u5230\u6682\u5b58\u533a\uff1agit add \u4f7f\u7528 git commit -m &#8220;&#8221;\u63d0\u4ea4\u4fe1\u606f&#8221;&#8221; \u63d0\u4ea4\u6682\u5b58\u6587\u4ef6\u5982\u679c\u4e0e\u8fdc\u7a0b\u5b58\u50a8\u5e93\u5173\u8054\uff0c\u53ef\u4ee5\u4f7f\u7528 git push origin \u63a8\u9001\u63d0\u4ea4\u7684\u66f4\u6539\n<\/p><\/blockquote>\n<p><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/202404\/09\/2024040911272437998.jpg\" class=\"aligncenter\" title=\"git\u547d\u4ee4\u63d0\u4ea4\u6307\u5b9a\u6587\u4ef6\u600e\u4e48\u64cd\u4f5c\u63d2\u56fe\" alt=\"git\u547d\u4ee4\u63d0\u4ea4\u6307\u5b9a\u6587\u4ef6\u600e\u4e48\u64cd\u4f5c\u63d2\u56fe\" \/><\/p>\n<p><strong>\u5982\u4f55\u4f7f\u7528 Git \u63d0\u4ea4\u6307\u5b9a\u6587\u4ef6<\/strong><\/p>\n<p>\u5728 Git \u4e2d\u63d0\u4ea4\u6307\u5b9a\u6587\u4ef6\u975e\u5e38\u7b80\u5355\uff0c\u4e0b\u9762\u662f\u8be6\u7ec6\u6b65\u9aa4\uff1a<\/p>\n<p><strong>\u6b65\u9aa4 1\uff1a\u6682\u5b58\u66f4\u6539<\/strong><\/p>\n<p>\u9996\u5148\uff0c\u4f60\u9700\u8981\u5c06\u4f60\u60f3\u8981\u63d0\u4ea4\u7684\u6587\u4ef6\u6682\u5b58\u5230 Git \u7684\u6682\u5b58\u533a\u3002\u4f60\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\uff1a<\/p>\n<pre>git add &lt;file-name&gt;<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>\u4f8b\u5982\uff0c\u8981\u6682\u5b58\u540d\u4e3a README.md \u7684\u6587\u4ef6\uff0c\u4f60\u53ef\u4ee5\u8fd0\u884c\uff1a<\/p>\n<pre>git add README.md<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p><strong>\u6b65\u9aa4 2\uff1a\u63d0\u4ea4\u66f4\u6539<\/strong><\/p>\n<p>\u6682\u5b58\u6587\u4ef6\u540e\uff0c\u4f60\u53ef\u4ee5\u4f7f\u7528  commit \u547d\u4ee4\u63d0\u4ea4\u66f4\u6539\u3002\u6b64\u547d\u4ee4\u5c06\u521b\u5efa\u4e00\u4e2a\u65b0\u7684\u63d0\u4ea4\uff0c\u5176\u4e2d\u5305\u542b\u6682\u5b58\u533a\u7684\u5f53\u524d\u72b6\u6001\u3002<\/p>\n<p>\u4f60\u53ef\u4ee5\u4f7f\u7528 -m \u9009\u9879\u6dfb\u52a0\u63d0\u4ea4\u6d88\u606f\uff1a<\/p>\n<pre>git commit -m \"\u63d0\u4ea4\u4fe1\u606f\"<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>\u4f8b\u5982\uff0c\u8981\u63d0\u4ea4\u66f4\u6539\u5e76\u6dfb\u52a0\u63d0\u4ea4\u6d88\u606f &#8220;\u4fee\u590d\u9519\u8bef&#8221;\uff0c\u4f60\u53ef\u4ee5\u8fd0\u884c\uff1a<\/p>\n<pre>git commit -m \"\u4fee\u590d\u9519\u8bef\"<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p><strong>\u6b65\u9aa4 3\uff1a\u63a8\u9001\u66f4\u6539\uff08\u53ef\u9009\uff09<\/strong><\/p>\n<p>\u5982\u679c\u4f60\u7684\u672c\u5730\u5b58\u50a8\u5e93\u4e0e\u8fdc\u7a0b\u5b58\u50a8\u5e93\uff08\u5982 GitHub\uff09\u5173\u8054\uff0c\u4f60\u53ef\u4ee5\u4f7f\u7528 git push \u547d\u4ee4\u5c06\u63d0\u4ea4\u7684\u66f4\u6539\u63a8\u9001\u5230\u8fdc\u7a0b\u5b58\u50a8\u5e93\uff1a<\/p>\n<pre>git push origin &lt;branch-name&gt;<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>\u5176\u4e2d origin \u662f\u8fdc\u7a0b\u5b58\u50a8\u5e93\u7684\u540d\u79f0\uff0c \u662f\u4f60\u8981\u63a8\u9001\u5230\u7684\u5206\u652f\u3002 <\/p>\n<p>\u4ee5\u4e0a\u5c31\u662f\u547d\u4ee4\u63d0\u4ea4\u6307\u5b9a\u6587\u4ef6\u600e\u4e48\u64cd\u4f5c\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>\u5982\u4f55\u5728 git \u4e2d\u63d0\u4ea4\u6307\u5b9a\u6587\u4ef6\uff1f\u5c06\u6587\u4ef6\u6682\u5b58\u5230\u6682\u5b58\u533a\uff1agit add \u4f7f\u7528 git commit -m &#8220;&#8221;\u63d0\u4ea4\u4fe1\u606f&#8221;&#8221; \u63d0\u4ea4\u6682\u5b58\u6587\u4ef6\u5982\u679c\u4e0e\u8fdc\u7a0b\u5b58\u50a8\u5e93\u5173\u8054\uff0c\u53ef\u4ee5\u4f7f\u7528 git push origin \u63a8\u9001\u63d0\u4ea4\u7684\u66f4\u6539 \u5982\u4f55\u4f7f\u7528 Git \u63d0\u4ea4\u6307\u5b9a\u6587\u4ef6 \u5728 Git \u4e2d\u63d0\u4ea4\u6307\u5b9a\u6587\u4ef6\u975e\u5e38\u7b80\u5355\uff0c\u4e0b\u9762\u662f\u8be6\u7ec6\u6b65\u9aa4\uff1a \u6b65\u9aa4 1\uff1a\u6682\u5b58\u66f4\u6539 \u9996\u5148\uff0c\u4f60\u9700\u8981\u5c06\u4f60\u60f3\u8981\u63d0\u4ea4\u7684\u6587\u4ef6\u6682\u5b58\u5230 Git \u7684\u6682\u5b58\u533a\u3002\u4f60\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\uff1a git add &lt;file-name&gt; \u767b\u5f55\u540e\u590d\u5236 \u4f8b\u5982\uff0c\u8981\u6682\u5b58\u540d\u4e3a README.md \u7684\u6587\u4ef6\uff0c\u4f60\u53ef\u4ee5\u8fd0\u884c\uff1a git add README.md \u767b\u5f55\u540e\u590d\u5236 \u6b65\u9aa4 2\uff1a\u63d0\u4ea4\u66f4\u6539 \u6682\u5b58\u6587\u4ef6\u540e\uff0c\u4f60\u53ef\u4ee5\u4f7f\u7528 commit \u547d\u4ee4\u63d0\u4ea4\u66f4\u6539\u3002\u6b64\u547d\u4ee4\u5c06\u521b\u5efa\u4e00\u4e2a\u65b0\u7684\u63d0\u4ea4\uff0c\u5176\u4e2d\u5305\u542b\u6682\u5b58\u533a\u7684\u5f53\u524d\u72b6\u6001\u3002 \u4f60\u53ef\u4ee5\u4f7f\u7528 -m \u9009\u9879\u6dfb\u52a0\u63d0\u4ea4\u6d88\u606f\uff1a git commit -m &#8220;\u63d0\u4ea4\u4fe1\u606f&#8221; \u767b\u5f55\u540e\u590d\u5236 \u4f8b\u5982\uff0c\u8981\u63d0\u4ea4\u66f4\u6539\u5e76\u6dfb\u52a0\u63d0\u4ea4\u6d88\u606f &#8220;\u4fee\u590d\u9519\u8bef&#8221;\uff0c\u4f60\u53ef\u4ee5\u8fd0\u884c\uff1a git commit -m &#8220;\u4fee\u590d\u9519\u8bef&#8221; [&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-21198","post","type-post","status-publish","format-standard","hentry","category-16"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/21198","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=21198"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/21198\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=21198"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=21198"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=21198"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}