{"id":21206,"date":"2024-11-19T15:53:51","date_gmt":"2024-11-19T07:53:51","guid":{"rendered":"https:\/\/fwq.ai\/blog\/21206\/"},"modified":"2024-11-19T15:53:51","modified_gmt":"2024-11-19T07:53:51","slug":"git%e6%80%8e%e4%b9%88%e6%8f%90%e4%ba%a4%e6%96%87%e4%bb%b6%e5%a4%b9","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/21206\/","title":{"rendered":"git\u600e\u4e48\u63d0\u4ea4\u6587\u4ef6\u5939"},"content":{"rendered":"<blockquote><p>\n  \u5728 git \u4e2d\u63d0\u4ea4\u6587\u4ef6\u5939\u7684\u6b65\u9aa4\uff1a\u4f7f\u7528 git add \u6682\u5b58\u6587\u4ef6\u5939\u53ca\u5176\u5185\u5bb9\u3002\u4f7f\u7528 git commit \u521b\u5efa\u63d0\u4ea4\u5e76\u6dfb\u52a0\u63d0\u4ea4\u6d88\u606f\u3002\u4f7f\u7528 git push \u5c06\u63d0\u4ea4\u63a8\u9001\u5230\u8fdc\u7a0b\u4ed3\u5e93\u3002\n<\/p><\/blockquote>\n<p><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/202404\/09\/2024040911542121253.jpg\" class=\"aligncenter\" title=\"git\u600e\u4e48\u63d0\u4ea4\u6587\u4ef6\u5939\u63d2\u56fe\" alt=\"git\u600e\u4e48\u63d0\u4ea4\u6587\u4ef6\u5939\u63d2\u56fe\" \/><\/p>\n<p><strong>\u5982\u4f55\u5728 Git \u4e2d\u63d0\u4ea4\u6587\u4ef6\u5939<\/strong><\/p>\n<p>Git \u662f\u4e00\u79cd\u5206\u5e03\u5f0f\u7248\u672c\u63a7\u5236\u7cfb\u7edf\uff0c\u5b83\u5141\u8bb8\u5f00\u53d1\u4eba\u5458\u8ddf\u8e2a\u4ee3\u7801\u66f4\u6539\u5e76\u534f\u540c\u5de5\u4f5c\u3002\u63d0\u4ea4\u6587\u4ef6\u5939\u662f Git \u5de5\u4f5c\u6d41\u7a0b\u4e2d\u7684\u91cd\u8981\u90e8\u5206\uff0c\u5b83\u5c06\u66f4\u6539\u63a8\u9001\u5230\u4e2d\u592e\u5b58\u50a8\u5e93\u3002<\/p>\n<p><strong>\u5982\u4f55\u63d0\u4ea4\u6587\u4ef6\u5939<\/strong><\/p>\n<p>\u8981\u63d0\u4ea4\u4e00\u4e2a\u6587\u4ef6\u5939\uff0c\u8bf7\u6309\u7167\u4ee5\u4e0b\u6b65\u9aa4\u64cd\u4f5c\uff1a<\/p>\n<p><strong>1. \u6253\u5f00 Git \u7ec8\u7aef\u6216 GUI<\/strong><\/p>\n<p>\u5728\u547d\u4ee4\u884c\u6216 Git \u56fe\u5f62\u7528\u6237\u754c\u9762\u4e2d\uff0c\u5bfc\u822a\u5230\u8981\u63d0\u4ea4\u7684\u6587\u4ef6\u5939\u3002<\/p>\n<p><strong>2. \u6682\u5b58\u66f4\u6539<\/strong><\/p>\n<p>\u4f7f\u7528  add \u547d\u4ee4\u5c06\u6587\u4ef6\u5939\u53ca\u5176\u6240\u6709\u5185\u5bb9\u6dfb\u52a0\u5230\u6682\u5b58\u533a\u57df\uff1a<\/p>\n<pre>git add &lt;\u6587\u4ef6\u5939\u8def\u5f84&gt;<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p><strong>3. \u63d0\u4ea4\u66f4\u6539<\/strong><\/p>\n<p>\u4f7f\u7528 git commit \u547d\u4ee4\u521b\u5efa\u63d0\u4ea4\uff1a<\/p>\n<pre>git commit -m \"&lt;\u63d0\u4ea4\u6d88\u606f&gt;\"<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>\u5176\u4e2d \u662f\u63d0\u4ea4\u7684\u7b80\u77ed\u63cf\u8ff0\u3002<\/p>\n<p><strong>4. \u63a8\u9001\u5230\u8fdc\u7a0b\u4ed3\u5e93<\/strong><\/p>\n<p>\u8981\u5c06\u4f60\u7684\u63d0\u4ea4\u63a8\u9001\u5230\u8fdc\u7a0b\u4ed3\u5e93\uff0c\u8bf7\u4f7f\u7528 git push \u547d\u4ee4\uff1a<\/p>\n<pre>git push origin &lt;\u5206\u652f\u540d\u79f0&gt;<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>\u5176\u4e2d \u662f\u4f60\u8981\u63a8\u9001\u5230\u5b83\u7684\u5206\u652f\u3002\u901a\u5e38\uff0c\u5b83\u662f main \u6216 master \u5206\u652f\u3002<\/p>\n<p><strong>\u793a\u4f8b<\/strong><\/p>\n<p>\u5047\u8bbe\u4f60\u6709\u4e00\u4e2a\u540d\u4e3a my_project \u7684\u6587\u4ef6\u5939\uff0c\u5176\u4e2d\u5305\u542b\u4e00\u4e9b\u66f4\u6539\u3002\u8981\u63d0\u4ea4\u6587\u4ef6\u5939\uff0c\u8bf7\u8fd0\u884c\u4ee5\u4e0b\u547d\u4ee4\uff1a<\/p>\n<pre>git add my_project\ngit commit -m \"\u66f4\u65b0 my_project\"\ngit push origin main<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>\u8fd9\u5c06\u6682\u5b58\u6587\u4ef6\u5939\u53ca\u5176\u6240\u6709\u5185\u5bb9\uff0c\u521b\u5efa\u63d0\u4ea4\uff0c\u5e76\u5c06\u5176\u63a8\u9001\u5230\u540d\u4e3a main \u7684\u8fdc\u7a0b\u5206\u652f\u3002<\/p>\n<p>\u4ee5\u4e0a\u5c31\u662f\u600e\u4e48\u63d0\u4ea4\u6587\u4ef6\u5939\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>\u5728 git \u4e2d\u63d0\u4ea4\u6587\u4ef6\u5939\u7684\u6b65\u9aa4\uff1a\u4f7f\u7528 git add \u6682\u5b58\u6587\u4ef6\u5939\u53ca\u5176\u5185\u5bb9\u3002\u4f7f\u7528 git commit \u521b\u5efa\u63d0\u4ea4\u5e76\u6dfb\u52a0\u63d0\u4ea4\u6d88\u606f\u3002\u4f7f\u7528 git push \u5c06\u63d0\u4ea4\u63a8\u9001\u5230\u8fdc\u7a0b\u4ed3\u5e93\u3002 \u5982\u4f55\u5728 Git \u4e2d\u63d0\u4ea4\u6587\u4ef6\u5939 Git \u662f\u4e00\u79cd\u5206\u5e03\u5f0f\u7248\u672c\u63a7\u5236\u7cfb\u7edf\uff0c\u5b83\u5141\u8bb8\u5f00\u53d1\u4eba\u5458\u8ddf\u8e2a\u4ee3\u7801\u66f4\u6539\u5e76\u534f\u540c\u5de5\u4f5c\u3002\u63d0\u4ea4\u6587\u4ef6\u5939\u662f Git \u5de5\u4f5c\u6d41\u7a0b\u4e2d\u7684\u91cd\u8981\u90e8\u5206\uff0c\u5b83\u5c06\u66f4\u6539\u63a8\u9001\u5230\u4e2d\u592e\u5b58\u50a8\u5e93\u3002 \u5982\u4f55\u63d0\u4ea4\u6587\u4ef6\u5939 \u8981\u63d0\u4ea4\u4e00\u4e2a\u6587\u4ef6\u5939\uff0c\u8bf7\u6309\u7167\u4ee5\u4e0b\u6b65\u9aa4\u64cd\u4f5c\uff1a 1. \u6253\u5f00 Git \u7ec8\u7aef\u6216 GUI \u5728\u547d\u4ee4\u884c\u6216 Git \u56fe\u5f62\u7528\u6237\u754c\u9762\u4e2d\uff0c\u5bfc\u822a\u5230\u8981\u63d0\u4ea4\u7684\u6587\u4ef6\u5939\u3002 2. \u6682\u5b58\u66f4\u6539 \u4f7f\u7528 add \u547d\u4ee4\u5c06\u6587\u4ef6\u5939\u53ca\u5176\u6240\u6709\u5185\u5bb9\u6dfb\u52a0\u5230\u6682\u5b58\u533a\u57df\uff1a git add &lt;\u6587\u4ef6\u5939\u8def\u5f84&gt; \u767b\u5f55\u540e\u590d\u5236 3. \u63d0\u4ea4\u66f4\u6539 \u4f7f\u7528 git commit \u547d\u4ee4\u521b\u5efa\u63d0\u4ea4\uff1a git commit -m &#8220;&lt;\u63d0\u4ea4\u6d88\u606f&gt;&#8221; \u767b\u5f55\u540e\u590d\u5236 \u5176\u4e2d \u662f\u63d0\u4ea4\u7684\u7b80\u77ed\u63cf\u8ff0\u3002 4. \u63a8\u9001\u5230\u8fdc\u7a0b\u4ed3\u5e93 \u8981\u5c06\u4f60\u7684\u63d0\u4ea4\u63a8\u9001\u5230\u8fdc\u7a0b\u4ed3\u5e93\uff0c\u8bf7\u4f7f\u7528 git [&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-21206","post","type-post","status-publish","format-standard","hentry","category-16"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/21206","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=21206"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/21206\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=21206"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=21206"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=21206"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}