{"id":203862,"date":"2025-05-22T09:35:47","date_gmt":"2025-05-22T01:35:47","guid":{"rendered":"https:\/\/server.hk\/cnblog\/203862\/"},"modified":"2025-05-22T09:35:47","modified_gmt":"2025-05-22T01:35:47","slug":"vs-code-git%e5%88%87%e6%8d%a2%e5%88%86%e6%94%af%e4%b8%a2%e5%a4%b1%e6%95%b0%e7%99%be%e4%b8%aa%e6%96%87%e4%bb%b6%e6%80%8e%e4%b9%88%e5%8a%9e%ef%bc%9f","status":"publish","type":"post","link":"https:\/\/server.hk\/cnblog\/203862\/","title":{"rendered":"VS Code Git\u5207\u6362\u5206\u652f\u4e22\u5931\u6570\u767e\u4e2a\u6587\u4ef6\u600e\u4e48\u529e\uff1f"},"content":{"rendered":"<p><b><\/b>     <\/p>\n<h1>VS Code Git\u5207\u6362\u5206\u652f\u4e22\u5931\u6570\u767e\u4e2a\u6587\u4ef6\u600e\u4e48\u529e\uff1f<\/h1>\n<p>\u6587\u7ae0\u5c0f\u767d\u4e00\u679a\uff0c\u6b63\u5728\u4e0d\u65ad\u5b66\u4e60\u79ef\u7d2f\u77e5\u8bc6\uff0c\u73b0\u5c06\u5b66\u4e60\u5230\u7684\u77e5\u8bc6\u8bb0\u5f55\u4e00\u4e0b\uff0c\u4e5f\u662f\u5c06\u6211\u7684\u6240\u5f97\u5206\u4eab\u7ed9\u5927\u5bb6\uff01\u800c\u4eca\u5929\u8fd9\u7bc7\u6587\u7ae0\u300aVS Code Git\u5207\u6362\u5206\u652f\u4e22\u5931\u6570\u767e\u4e2a\u6587\u4ef6\u600e\u4e48\u529e\uff1f\u300b\u5e26\u5927\u5bb6\u6765\u4e86\u89e3\u4e00\u4e0b##content_title##\uff0c\u5e0c\u671b\u5bf9\u5927\u5bb6\u7684\u77e5\u8bc6\u79ef\u7d2f\u6709\u6240\u5e2e\u52a9\uff0c\u4ece\u800c\u5f25\u8865\u81ea\u5df1\u7684\u4e0d\u8db3\uff0c\u52a9\u529b\u5b9e\u6218\u5f00\u53d1\uff01<\/p>\n<p><\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.17golang.com\/uploads\/20241129\/1732845995674921ab02b96.jpg\" class=\"aligncenter\"><\/p>\n<p><strong>VS Code \u4e2d Git \u5bfc\u81f4\u6570\u767e\u4e2a\u6587\u4ef6\u4e22\u5931<\/strong><\/p>\n<p><strong>\u95ee\u9898\u63cf\u8ff0\uff1a<\/strong><\/p>\n<p>\u5728\u4f7f\u7528 VS Code \u4e2d\u7684 Git \u65f6\uff0c\u5c1d\u8bd5\u4ece\u4e3b\u5206\u652f\u5207\u6362\u5230\u6d4b\u8bd5\u5206\u652f\uff0c\u4f46\u51fa\u73b0\u4e86\u95ee\u9898\u3002\u7136\u540e\uff0c\u6570\u767e\u4e2a\u6587\u4ef6\u7a81\u7136\u88ab\u5220\u9664\uff0c\u8fd9\u662f\u600e\u4e48\u56de\u4e8b\uff1f<\/p>\n<p><strong>\u5206\u6790\uff1a<\/strong><\/p>\n<p>\u901a\u5e38\uff0c\u4f7f\u7528 Git \u8fdb\u884c\u68c0\u51fa\u4e0d\u4f1a\u5bfc\u81f4\u6587\u4ef6\u4e22\u5931\u3002\u7136\u800c\uff0c\u5982\u679c\u4ee3\u7801\u5b58\u5728\u5dee\u5f02\uff0c\u5207\u6362\u5230\u5176\u4ed6\u5206\u652f\u53ef\u80fd\u4f1a\u5931\u8d25\u3002\u8fd9\u8868\u660e\u53ef\u80fd\u5b58\u5728\u8bef\u64cd\u4f5c\uff0c\u5bfc\u81f4\u5408\u5e76\u6216\u57fa\u7840\u53d8\u66f4\uff0c\u5e76\u5728\u540e\u7eed\u5408\u5e76\u8fc7\u7a0b\u4e2d\u5f15\u8d77\u51b2\u7a81\u3002\u5982\u679c\u7528\u6237\u53d6\u6d88\u4e86\u5408\u5e76\u6216\u57fa\u7840\u53d8\u66f4\uff0c\u5219\u4f1a\u5bfc\u81f4\u6587\u4ef6\u51fa\u73b0\u672a\u63d0\u4ea4\u7684\u53d8\u66f4\u3002<\/p>\n<p><strong>\u89e3\u51b3\u65b9\u6848\uff1a<\/strong><\/p>\n<p>\u5982\u679c\u4e4b\u524d\u7684\u64cd\u4f5c\u5df2\u63d0\u4ea4\uff0c\u5219\u65e0\u9700\u62c5\u5fc3\u8fd9\u4e9b\u53d8\u66f4\u3002\u53ea\u9700\u653e\u5f03\u6240\u6709\u6682\u5b58\u7684\u6587\u4ef6\uff0c\u7136\u540e\u91cd\u65b0\u68c0\u51fa\u5e76\u5207\u6362\u5206\u652f\u5373\u53ef\uff1a<\/p>\n<ol>\n<li>\u4f7f\u7528 git stash \u547d\u4ee4\u653e\u5f03\u6240\u6709\u6682\u5b58\u7684\u53d8\u66f4\u3002<\/li>\n<li>\u4f7f\u7528 git checkout master \u547d\u4ee4\u68c0\u51fa\u4e3b\u5206\u652f\u3002<\/li>\n<li>\u4f7f\u7528 git pull \u547d\u4ee4\u62c9\u53d6\u6700\u65b0\u66f4\u6539\u3002<\/li>\n<li>\u4f7f\u7528 git checkout test \u547d\u4ee4\u5207\u6362\u5230\u6d4b\u8bd5\u5206\u652f\u3002<\/li>\n<\/ol>\n<p>\u4ee5\u4e0a\u5c31\u662f\u672c\u6587\u7684\u5168\u90e8\u5185\u5bb9\u4e86\uff0c\u662f\u5426\u6709\u987a\u5229\u5e2e\u52a9\u4f60\u89e3\u51b3\u95ee\u9898\uff1f\u82e5\u662f\u80fd\u7ed9\u4f60\u5e26\u6765\u5b66\u4e60\u4e0a\u7684\u5e2e\u52a9\uff0c\u8bf7\u5927\u5bb6\u591a\u591a\u652f\u6301\uff01\u66f4\u591a\u5173\u4e8e\u6587\u7ae0\u7684\u76f8\u5173\u77e5\u8bc6\uff0c\u4e5f\u53ef\u5173\u6ce8\u516c\u4f17\u53f7\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>VS Code Git\u5207\u6362\u5206\u652f\u4e22&#46;&#46;&#46;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4925],"tags":[],"class_list":["post-203862","post","type-post","status-publish","format-standard","hentry","category-4925"],"_links":{"self":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/203862","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/comments?post=203862"}],"version-history":[{"count":0,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/203862\/revisions"}],"wp:attachment":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/media?parent=203862"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/categories?post=203862"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/tags?post=203862"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}