{"id":21520,"date":"2024-11-19T16:35:50","date_gmt":"2024-11-19T08:35:50","guid":{"rendered":"https:\/\/fwq.ai\/blog\/21520\/"},"modified":"2024-11-19T16:35:50","modified_gmt":"2024-11-19T08:35:50","slug":"git%e6%80%8e%e4%b9%88%e6%8f%90%e4%ba%a4%e7%a9%ba%e6%96%87%e4%bb%b6%e5%a4%b9","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/21520\/","title":{"rendered":"git\u600e\u4e48\u63d0\u4ea4\u7a7a\u6587\u4ef6\u5939"},"content":{"rendered":"<blockquote><p>\n  \u5728 git \u4e2d\u63d0\u4ea4\u7a7a\u6587\u4ef6\u5939\uff0c\u53ea\u9700\u9075\u5faa\u4ee5\u4e0b\u6b65\u9aa4\uff1a1. \u521b\u5efa\u7a7a\u6587\u4ef6\u5939\uff1b2. \u5c06\u6587\u4ef6\u5939\u6dfb\u52a0\u5230\u6682\u5b58\u533a\uff1b3. \u63d0\u4ea4\u66f4\u6539\uff0c\u5e76\u8f93\u5165\u63d0\u4ea4\u6d88\u606f\uff1b4. \uff08\u53ef\u9009\uff09\u5c06\u66f4\u6539\u63a8\u9001\u5230\u8fdc\u7a0b\u5b58\u50a8\u5e93\u3002\u6ce8\u610f\uff1a\u7a7a\u6587\u4ef6\u5939\u7684\u540d\u79f0\u4e0d\u80fd\u4ee5 . \u5f00\u5934\uff0c\u5982\u679c\u6587\u4ef6\u5939\u5df2\u5b58\u5728\uff0c\u9700\u8981\u4f7f\u7528 git add &#8211;force \u6dfb\u52a0\u3002\n<\/p><\/blockquote>\n<p><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/202405\/30\/2024053023061911971.jpg\" class=\"aligncenter\" title=\"git\u600e\u4e48\u63d0\u4ea4\u7a7a\u6587\u4ef6\u5939\u63d2\u56fe\" alt=\"git\u600e\u4e48\u63d0\u4ea4\u7a7a\u6587\u4ef6\u5939\u63d2\u56fe\" \/><\/p>\n<p><strong>\u5982\u4f55\u4f7f\u7528 Git \u63d0\u4ea4\u7a7a\u6587\u4ef6\u5939<\/strong><\/p>\n<p>\u5728 Git \u4e2d\u63d0\u4ea4\u7a7a\u6587\u4ef6\u5939\u975e\u5e38\u7b80\u5355\u3002\u53ea\u9700\u4ee5\u4e0b\u51e0\u4e2a\u6b65\u9aa4\uff1a<\/p>\n<p><strong>\u6b65\u9aa4 1\uff1a\u521b\u5efa\u7a7a\u6587\u4ef6\u5939<\/strong><\/p>\n<p>\u5728\u4f60\u7684\u9879\u76ee\u5de5\u4f5c\u76ee\u5f55\u4e2d\uff0c\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u521b\u5efa\u7a7a\u6587\u4ef6\u5939\uff1a<\/p>\n<pre>mkdir \u7a7a\u6587\u4ef6\u5939\u540d\u79f0<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p><strong>\u6b65\u9aa4 2\uff1a\u5c06\u6587\u4ef6\u5939\u6dfb\u52a0\u5230\u6682\u5b58\u533a<\/strong><\/p>\n<p>\u4f7f\u7528  add \u547d\u4ee4\u5c06\u7a7a\u6587\u4ef6\u5939\u6dfb\u52a0\u5230\u6682\u5b58\u533a\uff1a<\/p>\n<pre>git add \u7a7a\u6587\u4ef6\u5939\u540d\u79f0<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p><strong>\u6b65\u9aa4 3\uff1a\u63d0\u4ea4\u66f4\u6539<\/strong><\/p>\n<p>\u8f93\u5165\u63d0\u4ea4\u6d88\u606f\uff0c\u5e76\u4f7f\u7528 git commit \u547d\u4ee4\u63d0\u4ea4\u4f60\u7684\u66f4\u6539\uff1a<\/p>\n<pre>git commit -m \"\u6dfb\u52a0\u7a7a\u6587\u4ef6\u5939\"<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p><strong>\u6b65\u9aa4 4\uff1a\u63a8\u9001\u66f4\u6539\uff08\u53ef\u9009\uff09<\/strong><\/p>\n<p>\u5982\u679c\u4f60\u60f3\u5c06\u66f4\u6539\u63a8\u9001\u5230\u8fdc\u7a0b\u5b58\u50a8\u5e93\uff0c\u53ef\u4ee5\u4f7f\u7528 git push \u547d\u4ee4\uff1a<\/p>\n<pre>git push origin \u4e3b\u5206\u652f\u540d\u79f0<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p><strong>\u6ce8\u610f\uff1a<\/strong><\/p>\n<ul>\n<li>\u7a7a\u6587\u4ef6\u5939\u7684\u540d\u79f0\u4e0d\u80fd\u662f .git \u6216\u4efb\u4f55\u5176\u4ed6\u4ee5 . \u5f00\u5934\u7684\u540d\u79f0\u3002<\/li>\n<li>\u5982\u679c\u7a7a\u6587\u4ef6\u5939\u5df2\u7ecf\u5b58\u5728\uff0c\u5219\u9700\u8981\u4f7f\u7528 git add &#8211;force \u547d\u4ee4\u5f3a\u5236\u5c06\u5176\u6dfb\u52a0\u5230\u6682\u5b58\u533a\u3002<\/li>\n<li>git commit \u547d\u4ee4\u4f1a\u5c06\u6682\u5b58\u533a\u4e2d\u7684\u6240\u6709\u6587\u4ef6\u63d0\u4ea4\u5230\u672c\u5730\u5b58\u50a8\u5e93\u3002<\/li>\n<li>git push \u547d\u4ee4\u4ec5\u5f53\u4f60\u6709\u63a8\u9001\u5230\u8fdc\u7a0b\u5b58\u50a8\u5e93\u7684\u6743\u9650\u65f6\u624d\u53ef\u7528\u3002<\/li>\n<\/ul>\n<p>\u4ee5\u4e0a\u5c31\u662f\u600e\u4e48\u63d0\u4ea4\u7a7a\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\u7a7a\u6587\u4ef6\u5939\uff0c\u53ea\u9700\u9075\u5faa\u4ee5\u4e0b\u6b65\u9aa4\uff1a1. \u521b\u5efa\u7a7a\u6587\u4ef6\u5939\uff1b2. \u5c06\u6587\u4ef6\u5939\u6dfb\u52a0\u5230\u6682\u5b58\u533a\uff1b3. \u63d0\u4ea4\u66f4\u6539\uff0c\u5e76\u8f93\u5165\u63d0\u4ea4\u6d88\u606f\uff1b4. \uff08\u53ef\u9009\uff09\u5c06\u66f4\u6539\u63a8\u9001\u5230\u8fdc\u7a0b\u5b58\u50a8\u5e93\u3002\u6ce8\u610f\uff1a\u7a7a\u6587\u4ef6\u5939\u7684\u540d\u79f0\u4e0d\u80fd\u4ee5 . \u5f00\u5934\uff0c\u5982\u679c\u6587\u4ef6\u5939\u5df2\u5b58\u5728\uff0c\u9700\u8981\u4f7f\u7528 git add &#8211;force \u6dfb\u52a0\u3002 \u5982\u4f55\u4f7f\u7528 Git \u63d0\u4ea4\u7a7a\u6587\u4ef6\u5939 \u5728 Git \u4e2d\u63d0\u4ea4\u7a7a\u6587\u4ef6\u5939\u975e\u5e38\u7b80\u5355\u3002\u53ea\u9700\u4ee5\u4e0b\u51e0\u4e2a\u6b65\u9aa4\uff1a \u6b65\u9aa4 1\uff1a\u521b\u5efa\u7a7a\u6587\u4ef6\u5939 \u5728\u4f60\u7684\u9879\u76ee\u5de5\u4f5c\u76ee\u5f55\u4e2d\uff0c\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u521b\u5efa\u7a7a\u6587\u4ef6\u5939\uff1a mkdir \u7a7a\u6587\u4ef6\u5939\u540d\u79f0 \u767b\u5f55\u540e\u590d\u5236 \u6b65\u9aa4 2\uff1a\u5c06\u6587\u4ef6\u5939\u6dfb\u52a0\u5230\u6682\u5b58\u533a \u4f7f\u7528 add \u547d\u4ee4\u5c06\u7a7a\u6587\u4ef6\u5939\u6dfb\u52a0\u5230\u6682\u5b58\u533a\uff1a git add \u7a7a\u6587\u4ef6\u5939\u540d\u79f0 \u767b\u5f55\u540e\u590d\u5236 \u6b65\u9aa4 3\uff1a\u63d0\u4ea4\u66f4\u6539 \u8f93\u5165\u63d0\u4ea4\u6d88\u606f\uff0c\u5e76\u4f7f\u7528 git commit \u547d\u4ee4\u63d0\u4ea4\u4f60\u7684\u66f4\u6539\uff1a git commit -m &#8220;\u6dfb\u52a0\u7a7a\u6587\u4ef6\u5939&#8221; \u767b\u5f55\u540e\u590d\u5236 \u6b65\u9aa4 4\uff1a\u63a8\u9001\u66f4\u6539\uff08\u53ef\u9009\uff09 \u5982\u679c\u4f60\u60f3\u5c06\u66f4\u6539\u63a8\u9001\u5230\u8fdc\u7a0b\u5b58\u50a8\u5e93\uff0c\u53ef\u4ee5\u4f7f\u7528 git push \u547d\u4ee4\uff1a git push origin \u4e3b\u5206\u652f\u540d\u79f0 [&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-21520","post","type-post","status-publish","format-standard","hentry","category-16"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/21520","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=21520"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/21520\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=21520"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=21520"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=21520"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}