{"id":21564,"date":"2024-11-19T11:59:05","date_gmt":"2024-11-19T03:59:05","guid":{"rendered":"https:\/\/fwq.ai\/blog\/21564\/"},"modified":"2024-11-19T11:59:05","modified_gmt":"2024-11-19T03:59:05","slug":"git%e6%80%8e%e4%b9%88%e6%9b%b4%e6%96%b0%e6%9c%80%e6%96%b0%e4%bb%a3%e7%a0%81","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/21564\/","title":{"rendered":"git\u600e\u4e48\u66f4\u65b0\u6700\u65b0\u4ee3\u7801"},"content":{"rendered":"<blockquote><p>\n  \u8981\u4f7f\u7528 git \u66f4\u65b0\u5230\u6700\u65b0\u4ee3\u7801\uff0c\u9700\u8981\u6267\u884c\u4ee5\u4e0b\u6b65\u9aa4\uff1a\u83b7\u53d6\u8fdc\u7a0b\u66f4\u65b0\uff1agit fetch\u5408\u5e76\u8fdc\u7a0b\u66f4\u65b0\u5230\u5f53\u524d\u5206\u652f\uff1agit merge origin\/main\u89e3\u51b3\u5408\u5e76\u51b2\u7a81\uff08\u5982\u679c\u5b58\u5728\uff09\u63a8\u9001\u5230\u8fdc\u7a0b\u4ed3\u5e93\uff08\u53ef\u9009\uff09\uff1agit push origin main\n<\/p><\/blockquote>\n<p><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/202405\/31\/2024053100065485748.jpg\" class=\"aligncenter\" title=\"git\u600e\u4e48\u66f4\u65b0\u6700\u65b0\u4ee3\u7801\u63d2\u56fe\" alt=\"git\u600e\u4e48\u66f4\u65b0\u6700\u65b0\u4ee3\u7801\u63d2\u56fe\" \/><\/p>\n<p><strong>\u5982\u4f55\u4f7f\u7528 Git \u66f4\u65b0\u5230\u6700\u65b0\u4ee3\u7801<\/strong><\/p>\n<p><strong>\u6b65\u9aa4 1\uff1a\u83b7\u53d6\u8fdc\u7a0b\u66f4\u65b0<\/strong><\/p>\n<ul>\n<li>\n<p>\u5728\u4f60\u7684\u4e2d\uff0c\u6267\u884c\u4ee5\u4e0b\u547d\u4ee4\uff1a<\/p>\n<pre>git fetch<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>\u8fd9\u5c06\u4ece\u8fdc\u7a0b\u4ed3\u5e93\u83b7\u53d6\u6700\u65b0\u7684\u66f4\u65b0\u3002<\/p>\n<\/li>\n<\/ul>\n<p><strong>\u6b65\u9aa4 2\uff1a\u5408\u5e76\u8fdc\u7a0b\u66f4\u65b0<\/strong><\/p>\n<ul>\n<li>\n<p>\u4e00\u65e6\u4f60\u83b7\u53d6\u4e86\u8fdc\u7a0b\u66f4\u65b0\uff0c\u5c31\u9700\u8981\u5c06\u5176\u5408\u5e76\u5230\u4f60\u7684\u5f53\u524d\u5206\u652f\u4e2d\u3002\u6267\u884c\u4ee5\u4e0b\u547d\u4ee4\uff1a<\/p>\n<pre>git merge origin\/main<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>\u5176\u4e2d origin\/main \u662f\u8fdc\u7a0b\u4ed3\u5e93\u4e2d\u7684\u4e3b\u5206\u652f\u3002<\/p>\n<\/li>\n<\/ul>\n<p><strong>\u6b65\u9aa4 3\uff1a\u89e3\u51b3\u5408\u5e76\u51b2\u7a81\uff08\u53ef\u9009\uff09<\/strong><\/p>\n<ul>\n<li>\u5982\u679c\u5408\u5e76\u5bfc\u81f4\u4e86\u51b2\u7a81\uff0c\u4f60\u5c06\u9700\u8981\u624b\u52a8\u89e3\u51b3\u5b83\u4eec\u3002\u4f7f\u7528\u6587\u672c\u7f16\u8f91\u5668\u6216 Git \u5408\u5e76\u5de5\u5177\u6765\u7f16\u8f91\u6709\u51b2\u7a81\u7684\u6587\u4ef6\u3002<\/li>\n<li>\n<p>\u89e3\u51b3\u51b2\u7a81\u540e\uff0c\u63d0\u4ea4\u5408\u5e76\uff1a<\/p>\n<pre>git add .\ngit commit -m \"Resolved merge conflicts\"<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/li>\n<\/ul>\n<p><strong>\u6b65\u9aa4 4\uff1a\u63a8\u9001\u5230\u8fdc\u7a0b\u4ed3\u5e93\uff08\u53ef\u9009\uff09<\/strong><\/p>\n<ul>\n<li>\n<p>\u5982\u679c\u4f60\u7684\u66f4\u65b0\u5305\u542b\u4e86\u65b0\u529f\u80fd\u6216\u4fee\u590d\uff0c\u4f60\u53ef\u80fd\u5e0c\u671b\u5c06\u5176\u63a8\u9001\u5230\u8fdc\u7a0b\u4ed3\u5e93\u4ee5\u4f7f\u5176\u53ef\u7528\u3002\u6267\u884c\u4ee5\u4e0b\u547d\u4ee4\uff1a<\/p>\n<pre>git push origin main<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/li>\n<\/ul>\n<p><strong>\u5176\u4ed6\u6ce8\u610f\u4e8b\u9879\uff1a<\/strong><\/p>\n<ul>\n<li>\u786e\u4fdd\u4f60\u5df2\u5c06\u8fdc\u7a0b\u4ed3\u5e93\u6dfb\u52a0\u5230\u4f60\u7684\u672c\u5730\u4ed3\u5e93\u3002<\/li>\n<li>\u5982\u679c\u4f60\u5728\u5408\u5e76\u6216\u63a8\u9001\u65f6\u9047\u5230\u4efb\u4f55\u95ee\u9898\uff0c\u53ef\u4ee5\u4f7f\u7528  status \u547d\u4ee4\u68c0\u67e5\u72b6\u6001\u3002<\/li>\n<li>\n<p>\u5982\u679c\u4f60\u60f3\u62c9\u53d6\u7279\u5b9a\u5206\u652f\u7684\u66f4\u65b0\uff0c\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\uff1a<\/p>\n<pre>git fetch origin branch-name<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>\u7136\u540e\u5408\u5e76\u5230\u4f60\u7684\u672c\u5730\u5206\u652f\u3002<\/p>\n<\/li>\n<\/ul>\n<p>\u4ee5\u4e0a\u5c31\u662f\u600e\u4e48\u66f4\u65b0\u6700\u65b0\u4ee3\u7801\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\u4f7f\u7528 git \u66f4\u65b0\u5230\u6700\u65b0\u4ee3\u7801\uff0c\u9700\u8981\u6267\u884c\u4ee5\u4e0b\u6b65\u9aa4\uff1a\u83b7\u53d6\u8fdc\u7a0b\u66f4\u65b0\uff1agit fetch\u5408\u5e76\u8fdc\u7a0b\u66f4\u65b0\u5230\u5f53\u524d\u5206\u652f\uff1agit merge origin\/main\u89e3\u51b3\u5408\u5e76\u51b2\u7a81\uff08\u5982\u679c\u5b58\u5728\uff09\u63a8\u9001\u5230\u8fdc\u7a0b\u4ed3\u5e93\uff08\u53ef\u9009\uff09\uff1agit push origin main \u5982\u4f55\u4f7f\u7528 Git \u66f4\u65b0\u5230\u6700\u65b0\u4ee3\u7801 \u6b65\u9aa4 1\uff1a\u83b7\u53d6\u8fdc\u7a0b\u66f4\u65b0 \u5728\u4f60\u7684\u4e2d\uff0c\u6267\u884c\u4ee5\u4e0b\u547d\u4ee4\uff1a git fetch \u767b\u5f55\u540e\u590d\u5236 \u8fd9\u5c06\u4ece\u8fdc\u7a0b\u4ed3\u5e93\u83b7\u53d6\u6700\u65b0\u7684\u66f4\u65b0\u3002 \u6b65\u9aa4 2\uff1a\u5408\u5e76\u8fdc\u7a0b\u66f4\u65b0 \u4e00\u65e6\u4f60\u83b7\u53d6\u4e86\u8fdc\u7a0b\u66f4\u65b0\uff0c\u5c31\u9700\u8981\u5c06\u5176\u5408\u5e76\u5230\u4f60\u7684\u5f53\u524d\u5206\u652f\u4e2d\u3002\u6267\u884c\u4ee5\u4e0b\u547d\u4ee4\uff1a git merge origin\/main \u767b\u5f55\u540e\u590d\u5236 \u5176\u4e2d origin\/main \u662f\u8fdc\u7a0b\u4ed3\u5e93\u4e2d\u7684\u4e3b\u5206\u652f\u3002 \u6b65\u9aa4 3\uff1a\u89e3\u51b3\u5408\u5e76\u51b2\u7a81\uff08\u53ef\u9009\uff09 \u5982\u679c\u5408\u5e76\u5bfc\u81f4\u4e86\u51b2\u7a81\uff0c\u4f60\u5c06\u9700\u8981\u624b\u52a8\u89e3\u51b3\u5b83\u4eec\u3002\u4f7f\u7528\u6587\u672c\u7f16\u8f91\u5668\u6216 Git \u5408\u5e76\u5de5\u5177\u6765\u7f16\u8f91\u6709\u51b2\u7a81\u7684\u6587\u4ef6\u3002 \u89e3\u51b3\u51b2\u7a81\u540e\uff0c\u63d0\u4ea4\u5408\u5e76\uff1a git add . git commit -m &#8220;Resolved merge conflicts&#8221; \u767b\u5f55\u540e\u590d\u5236 \u6b65\u9aa4 4\uff1a\u63a8\u9001\u5230\u8fdc\u7a0b\u4ed3\u5e93\uff08\u53ef\u9009\uff09 \u5982\u679c\u4f60\u7684\u66f4\u65b0\u5305\u542b\u4e86\u65b0\u529f\u80fd\u6216\u4fee\u590d\uff0c\u4f60\u53ef\u80fd\u5e0c\u671b\u5c06\u5176\u63a8\u9001\u5230\u8fdc\u7a0b\u4ed3\u5e93\u4ee5\u4f7f\u5176\u53ef\u7528\u3002\u6267\u884c\u4ee5\u4e0b\u547d\u4ee4\uff1a git push origin main \u767b\u5f55\u540e\u590d\u5236 \u5176\u4ed6\u6ce8\u610f\u4e8b\u9879\uff1a \u786e\u4fdd\u4f60\u5df2\u5c06\u8fdc\u7a0b\u4ed3\u5e93\u6dfb\u52a0\u5230\u4f60\u7684\u672c\u5730\u4ed3\u5e93\u3002 [&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-21564","post","type-post","status-publish","format-standard","hentry","category-16"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/21564","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=21564"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/21564\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=21564"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=21564"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=21564"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}