{"id":5294,"date":"2021-11-25T14:24:42","date_gmt":"2021-11-25T06:24:42","guid":{"rendered":"https:\/\/www.xttblog.com\/?p=5294"},"modified":"2021-11-25T14:24:42","modified_gmt":"2021-11-25T06:24:42","slug":"%e4%bf%ae%e5%a4%8didea-git%e6%8a%a5move-or-commit-them-before-checkout%e9%94%99%e8%af%af%e9%97%ae%e9%a2%98","status":"publish","type":"post","link":"https:\/\/www.xttblog.com\/?p=5294","title":{"rendered":"\u4fee\u590didea git\u62a5Move or commit them before checkout\u9519\u8bef\u95ee\u9898"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">\u6700\u8fd1\u516c\u53f8\u62db\u4e86\u4e00\u4e2a 7 \u5e74\u7684 Java \u8001\u53f8\u673a\uff0c\u4f46\u662f\u8fd9\u4f4d\u8001\u53f8\u673a\u4e0d\u4f1a\u7528 git\uff0c\u5bfc\u81f4\u5728\u67d0\u6b21\u63d0\u4ea4\u540e\u51fa\u73b0\u4e86\u5927\u91cf\u7684\u51b2\u7a81\uff0c\u4ed6\u4e0d\u4f1a\u89e3\u51b3\u3002\u5408\u5e76\u6389\u4e86\u4e0d\u5c11\u4ee3\u7801\uff0c\u4e00\u987f\u9a9a\u64cd\u4f5c\u4e4b\u540e\uff0c\u53c8\u51fa\u73b0\u4e86\u201cMove or commit them before checkout\u201d\u9519\u8bef\u3002\u4ed6\u5728\u7f51\u4e0a\u67e5\u4e86\u4e0d\u5c11\u8d44\u6599\uff0c\u6ca1\u6709\u627e\u5230\u5408\u7406\u7684\u89e3\u51b3\u529e\u6cd5\u3002\u672c\u6587\u8bb0\u5f55\u4e00\u4e0b\uff0c\u6211\u7684\u89e3\u51b3\u601d\u8def\u548c\u529e\u6cd5\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u6839\u636e\u9519\u8bef\u63d0\u793a\u201cMove or commit them before checkout\u201d\uff0c\u8868\u793a\u5728\u6211\u4eec\u8fdb\u884c checkout \u4e4b\u524d\uff0c\u5148\u628a\u8fd9\u4e9b untracked files \u7684 Java \u6587\u4ef6\u8fdb\u884c\u79fb\u52a8\uff0c\u6216\u8005\u8fdb\u884c commit\u3002<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter\"><img decoding=\"async\" src=\"https:\/\/cdn.jsdelivr.net\/gh\/xmt1139057136\/xttblog\/2021\/11\/git-err.png\" alt=\"\" \/><figcaption>Move or commit them before checkout<\/figcaption><\/figure><\/div>\n\n\n\n<p class=\"wp-block-paragraph\">\u56e0\u6b64\uff0c\u6211\u4eec\u53ef\u4ee5\u5148\u8fdb\u884c commit\uff0c\u7136\u540e\u518d reset\u3002\u76f4\u63a5\u653e\u5f03\u672c\u5730\u7684\u8fd9\u4e9b untracked files\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>git branch\ngit reset --hard origin\/release\ngit add .\/ \ngit reset --hard origin\/release<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u5f53\u7136\uff0c\u5982\u679c\u4f60\u8981\u4fdd\u7559\u5e76\u8ffd\u8e2a\u8fd9\u4e9b\u6587\u4ef6\uff0c\u53ef\u4ee5\u5148\u8fdb\u884c git add\uff0c\u7136\u540e\u9009\u62e9\u63d0\u4ea4\u6216\u8005\u6682\u5b58\uff0c\u5c31\u53ef\u4ee5\u8fdb\u884c\u5206\u652f\u5207\u6362\u4e86\u3002<\/p>\n<!-- <audio autoplay=\"autoplay\" height=\"100\" width=\"100\" hidden=\"true\"><source src=\"https:\/\/c.coka.la\/orAvPR.mp3\" type=\"audio\/mp3\"\/><\/audio><img decoding=\"async\" src=\"https:\/\/images.weserv.nl\/?url=https:\/\/ws3.sinaimg.cn\/large\/8fa5dcfcgy1g4em3rzar5j20ib089ae0.jpg\" alt=\"\u4e1a\u4f59\u8349\u516c\u4f17\u53f7\"\/> --><p><!-- <img decoding=\"async\" src=\"https:\/\/raw.githubusercontent.com\/xmt1139057136\/xttblog\/master\/8fa5dcfcgy1g4em3rzar5j20ib089ae0.jpg\" alt=\"\u4e1a\u4f59\u8349\u516c\u4f17\u53f7\"\/>--><img decoding=\"async\" src=\"https:\/\/saas.51autoparts.cn\/api\/admin\/sys-file\/oss\/file?fileName=84db51f8561e448f9a4fda2eff0811f9.jpg\" alt=\"\u4e1a\u4f59\u8349\u516c\u4f17\u53f7\"\/><\/p><p>\u6700\u540e\uff0c\u6b22\u8fce\u5173\u6ce8\u6211\u7684\u4e2a\u4eba\u5fae\u4fe1\u516c\u4f17\u53f7\uff1a\u4e1a\u4f59\u8349\uff08yyucao\uff09\uff01<b>\u53ef\u52a0\u4f5c\u8005\u5fae\u4fe1\u53f7\uff1a<font color=\"red\">xttblog2<\/font>\u3002\u5907\u6ce8\uff1a\u201c1\u201d\uff0c\u6dfb\u52a0\u535a\u4e3b\u5fae\u4fe1\u62c9\u4f60\u8fdb\u5fae\u4fe1\u7fa4\u3002\u5907\u6ce8\u9519\u8bef\u4e0d\u4f1a\u540c\u610f\u597d\u53cb\u7533\u8bf7\u3002<\/b>\u518d\u6b21\u611f\u8c22\u60a8\u7684\u5173\u6ce8\uff01\u540e\u7eed\u6709\u7cbe\u5f69\u5185\u5bb9\u4f1a\u7b2c\u4e00\u65f6\u95f4\u53d1\u7ed9\u60a8\uff01\u539f\u521b\u6587\u7ae0\u6295\u7a3f\u8bf7\u53d1\u9001\u81f3532009913@qq.com\u90ae\u7bb1\u3002\u5546\u52a1\u5408\u4f5c\u4e5f\u53ef\u6dfb\u52a0\u4f5c\u8005\u5fae\u4fe1\u8fdb\u884c\u8054\u7cfb\uff01<\/p><p>\u672c\u6587\u539f\u6587\u51fa\u5904\uff1a<a href=\"https:\/\/www.xttblog.com\">\u4e1a\u4f59\u8349<\/a>\uff1a &raquo; <a href=\"https:\/\/www.xttblog.com\/?p=5294\">\u4fee\u590didea git\u62a5Move or commit them before checkout\u9519\u8bef\u95ee\u9898<\/a><\/p><!-- <div class=\"bd-reward-stl\"><button id=\"bdRewardBtn\"><span><\/span><\/button><\/div> -->","protected":false},"excerpt":{"rendered":"<p>\u6700\u8fd1\u516c\u53f8\u62db\u4e86\u4e00\u4e2a 7 \u5e74\u7684 Java \u8001\u53f8\u673a\uff0c\u4f46\u662f\u8fd9\u4f4d\u8001\u53f8\u673a\u4e0d\u4f1a\u7528 git\uff0c\u5bfc\u81f4\u5728\u67d0\u6b21\u63d0\u4ea4\u540e\u51fa\u73b0\u4e86\u5927\u91cf\u7684\u51b2\u7a81\uff0c [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[6],"tags":[1438,1460,1639,1437,1458],"class_list":["post-5294","post","type-post","status-publish","format-standard","hentry","category-yyzt","tag-git","tag-git-","tag-gitalk","tag-github"],"_links":{"self":[{"href":"https:\/\/www.xttblog.com\/index.php?rest_route=\/wp\/v2\/posts\/5294","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.xttblog.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.xttblog.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.xttblog.com\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.xttblog.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=5294"}],"version-history":[{"count":1,"href":"https:\/\/www.xttblog.com\/index.php?rest_route=\/wp\/v2\/posts\/5294\/revisions"}],"predecessor-version":[{"id":5295,"href":"https:\/\/www.xttblog.com\/index.php?rest_route=\/wp\/v2\/posts\/5294\/revisions\/5295"}],"wp:attachment":[{"href":"https:\/\/www.xttblog.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=5294"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.xttblog.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=5294"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.xttblog.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=5294"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}