{"id":21582,"date":"2024-11-19T08:48:45","date_gmt":"2024-11-19T00:48:45","guid":{"rendered":"https:\/\/fwq.ai\/blog\/21582\/"},"modified":"2024-11-19T08:48:45","modified_gmt":"2024-11-19T00:48:45","slug":"git%e6%80%8e%e4%b9%88%e4%b8%8a%e4%bc%a0%e6%9c%ac%e5%9c%b0%e9%a1%b9%e7%9b%ae","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/21582\/","title":{"rendered":"git\u600e\u4e48\u4e0a\u4f20\u672c\u5730\u9879\u76ee"},"content":{"rendered":"<blockquote><p>\n  \u8981\u5c06\u672c\u5730\u9879\u76ee\u4e0a\u4f20\u5230 git\uff0c\u8bf7\u4f9d\u6b21\u6267\u884c\u4ee5\u4e0b\u6b65\u9aa4\uff1a1. \u521d\u59cb\u5316 git \u4ed3\u5e93\uff1b2. \u5c06\u6587\u4ef6\u6dfb\u52a0\u5230\u6682\u5b58\u533a\uff1b3. \u63d0\u4ea4\u66f4\u6539\uff1b4. \u5173\u8054\u8fdc\u7a0b\u4ed3\u5e93\uff1b5. \u63a8\u9001\u4ee3\u7801\u3002\u5176\u4ed6\u63d0\u793a\u5305\u62ec\uff1a\u4f7f\u7528 git status \u68c0\u67e5\u72b6\u6001\uff0c\u4f7f\u7528 git reset \u56de\u6eda\u66f4\u6539\uff0c\u4f7f\u7528 git fetch \u67e5\u770b\u8fdc\u7a0b\u66f4\u6539\u3002\n<\/p><\/blockquote>\n<p><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/202405\/31\/2024053101303640227.jpg\" class=\"aligncenter\" title=\"git\u600e\u4e48\u4e0a\u4f20\u672c\u5730\u9879\u76ee\u63d2\u56fe\" alt=\"git\u600e\u4e48\u4e0a\u4f20\u672c\u5730\u9879\u76ee\u63d2\u56fe\" \/><\/p>\n<p><strong>\u5982\u4f55\u5c06\u672c\u5730\u9879\u76ee\u4e0a\u4f20\u81f3 Git<\/strong><\/p>\n<p><strong>\u7b2c\u4e00\u6b65\uff1a\u521d\u59cb\u5316 Git \u4ed3\u5e93<\/strong><\/p>\n<ul>\n<li>\u5728\u9879\u76ee\u7684\u6839\u76ee\u5f55\u4e0b\uff0c\u6253\u5f00\u7ec8\u7aef\u6216\u547d\u4ee4\u63d0\u793a\u7b26\u3002<\/li>\n<li>\n<p>\u8f93\u5165\u4ee5\u4e0b\u547d\u4ee4\uff1a<\/p>\n<pre>git init<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/li>\n<\/ul>\n<p><strong>\u7b2c\u4e8c\u6b65\uff1a\u6dfb\u52a0\u6587\u4ef6\u5230\u6682\u5b58\u533a<\/strong><\/p>\n<ul>\n<li>\n<p>\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u5c06\u6587\u4ef6\u6dfb\u52a0\u5230\u6682\u5b58\u533a\uff1a<\/p>\n<pre>git add .<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>\u6b64\u547d\u4ee4\u5c06\u6dfb\u52a0\u9879\u76ee\u4e2d\u6240\u6709\u672a\u88ab\u8ddf\u8e2a\u7684\u6587\u4ef6\u3002<\/p>\n<\/li>\n<\/ul>\n<p><strong>\u7b2c\u4e09\u6b65\uff1a\u63d0\u4ea4\u66f4\u6539<\/strong><\/p>\n<ul>\n<li>\n<p>\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u63d0\u4ea4\u6682\u5b58\u533a\u7684\u66f4\u6539\uff1a<\/p>\n<pre>git commit -m \"\u63d0\u4ea4\u4fe1\u606f\"<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>\u5c06 \u63d0\u4ea4\u4fe1\u606f \u66ff\u6362\u4e3a\u7b80\u8981\u63cf\u8ff0\u60a8\u6240\u505a\u66f4\u6539\u7684\u6587\u5b57\u3002<\/p>\n<\/li>\n<\/ul>\n<p><strong>\u7b2c\u56db\u6b65\uff1a\u5173\u8054\u8fdc\u7a0b\u4ed3\u5e93<\/strong><\/p>\n<ul>\n<li>\n<p>\u5982\u679c\u60a8\u8fd8\u6ca1\u6709\u8fdc\u7a0b\u4ed3\u5e93\uff0c\u8bf7\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u521b\u5efa\u4e00\u4e2a\uff1a<\/p>\n<pre>git remote add origin &lt;\u8fdc\u7a0b\u4ed3\u5e93 URL&gt;<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>\u5c06 \u66ff\u6362\u4e3a\u8fdc\u7a0b\u4ed3\u5e93\u7684\u5730\u5740\u3002<\/p>\n<\/li>\n<\/ul>\n<p><strong>\u7b2c\u4e94\u6b65\uff1a\u63a8\u9001\u4ee3\u7801<\/strong><\/p>\n<ul>\n<li>\n<p>\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u5c06\u672c\u5730\u66f4\u6539\u63a8\u9001\u5230\u8fdc\u7a0b\u4ed3\u5e93\uff1a<\/p>\n<pre>git push origin master<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>\u5c06 origin \u66ff\u6362\u4e3a\u8fdc\u7a0b\u4ed3\u5e93\u7684\u540d\u79f0\uff0c\u5c06 master \u66ff\u6362\u4e3a\u8981\u63a8\u9001\u5230\u7684\u5206\u652f\u3002<\/p>\n<\/li>\n<\/ul>\n<p><strong>\u5176\u4ed6\u63d0\u793a\uff1a<\/strong><\/p>\n<ul>\n<li>\u4f7f\u7528  status \u547d\u4ee4\u968f\u65f6\u68c0\u67e5\u9879\u76ee\u7684\u5f53\u524d\u72b6\u6001\u3002<\/li>\n<li>\u5982\u6709\u5fc5\u8981\uff0c\u53ef\u4ee5\u4f7f\u7528 git reset \u547d\u4ee4\u56de\u6eda\u672c\u5730\u66f4\u6539\u3002<\/li>\n<li>\u8981\u67e5\u770b\u8fdc\u7a0b\u4ed3\u5e93\u4e2d\u5df2\u6709\u7684\u66f4\u6539\uff0c\u53ef\u4ee5\u4f7f\u7528 git fetch \u547d\u4ee4\u3002<\/li>\n<\/ul>\n<p>\u4ee5\u4e0a\u5c31\u662f\u600e\u4e48\u4e0a\u4f20\u672c\u5730\u9879\u76ee\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>\u8981\u5c06\u672c\u5730\u9879\u76ee\u4e0a\u4f20\u5230 git\uff0c\u8bf7\u4f9d\u6b21\u6267\u884c\u4ee5\u4e0b\u6b65\u9aa4\uff1a1. \u521d\u59cb\u5316 git \u4ed3\u5e93\uff1b2. \u5c06\u6587\u4ef6\u6dfb\u52a0\u5230\u6682\u5b58\u533a\uff1b3. \u63d0\u4ea4\u66f4\u6539\uff1b4. \u5173\u8054\u8fdc\u7a0b\u4ed3\u5e93\uff1b5. \u63a8\u9001\u4ee3\u7801\u3002\u5176\u4ed6\u63d0\u793a\u5305\u62ec\uff1a\u4f7f\u7528 git status \u68c0\u67e5\u72b6\u6001\uff0c\u4f7f\u7528 git reset \u56de\u6eda\u66f4\u6539\uff0c\u4f7f\u7528 git fetch \u67e5\u770b\u8fdc\u7a0b\u66f4\u6539\u3002 \u5982\u4f55\u5c06\u672c\u5730\u9879\u76ee\u4e0a\u4f20\u81f3 Git \u7b2c\u4e00\u6b65\uff1a\u521d\u59cb\u5316 Git \u4ed3\u5e93 \u5728\u9879\u76ee\u7684\u6839\u76ee\u5f55\u4e0b\uff0c\u6253\u5f00\u7ec8\u7aef\u6216\u547d\u4ee4\u63d0\u793a\u7b26\u3002 \u8f93\u5165\u4ee5\u4e0b\u547d\u4ee4\uff1a git init \u767b\u5f55\u540e\u590d\u5236 \u7b2c\u4e8c\u6b65\uff1a\u6dfb\u52a0\u6587\u4ef6\u5230\u6682\u5b58\u533a \u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u5c06\u6587\u4ef6\u6dfb\u52a0\u5230\u6682\u5b58\u533a\uff1a git add . \u767b\u5f55\u540e\u590d\u5236 \u6b64\u547d\u4ee4\u5c06\u6dfb\u52a0\u9879\u76ee\u4e2d\u6240\u6709\u672a\u88ab\u8ddf\u8e2a\u7684\u6587\u4ef6\u3002 \u7b2c\u4e09\u6b65\uff1a\u63d0\u4ea4\u66f4\u6539 \u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u63d0\u4ea4\u6682\u5b58\u533a\u7684\u66f4\u6539\uff1a git commit -m &#8220;\u63d0\u4ea4\u4fe1\u606f&#8221; \u767b\u5f55\u540e\u590d\u5236 \u5c06 \u63d0\u4ea4\u4fe1\u606f \u66ff\u6362\u4e3a\u7b80\u8981\u63cf\u8ff0\u60a8\u6240\u505a\u66f4\u6539\u7684\u6587\u5b57\u3002 \u7b2c\u56db\u6b65\uff1a\u5173\u8054\u8fdc\u7a0b\u4ed3\u5e93 \u5982\u679c\u60a8\u8fd8\u6ca1\u6709\u8fdc\u7a0b\u4ed3\u5e93\uff0c\u8bf7\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u521b\u5efa\u4e00\u4e2a\uff1a git remote add origin &lt;\u8fdc\u7a0b\u4ed3\u5e93 URL&gt; \u767b\u5f55\u540e\u590d\u5236 \u5c06 [&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-21582","post","type-post","status-publish","format-standard","hentry","category-16"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/21582","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=21582"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/21582\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=21582"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=21582"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=21582"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}