{"id":206773,"date":"2023-08-14T02:10:18","date_gmt":"2023-08-13T18:10:18","guid":{"rendered":"https:\/\/www.idc.net\/help\/206773\/"},"modified":"2023-08-14T02:10:18","modified_gmt":"2023-08-13T18:10:18","slug":"android%e5%bc%80%e5%8f%91git%e4%bb%a3%e7%a0%81%e5%86%b2%e7%aa%81%e5%b8%b8%e8%a7%81%e8%a7%a3%e5%86%b3%e6%96%b9%e6%b3%95","status":"publish","type":"post","link":"https:\/\/idc.net\/help\/206773\/","title":{"rendered":"Android\u5f00\u53d1Git:\u4ee3\u7801\u51b2\u7a81\u5e38\u89c1\u89e3\u51b3\u65b9\u6cd5"},"content":{"rendered":"<p>\u5982\u679c\u7cfb\u7edf\u4e2d\u6709\u4e00\u4e9b\u914d\u7f6e\u6587\u4ef6\u5728\u670d\u52a1\u5668\u4e0a\u505a\u4e86\u914d\u7f6e\u4fee\u6539,\u7136\u540e\u540e\u7eed\u5f00\u53d1\u53c8\u65b0\u6dfb\u52a0\u4e00\u4e9b\u914d\u7f6e\u9879\u7684\u65f6\u5019,<\/p>\n<p>\u5728\u53d1\u5e03\u8fd9\u4e2a\u914d\u7f6e\u6587\u4ef6\u7684\u65f6\u5019,\u4f1a\u53d1\u751f\u4ee3\u7801\u51b2\u7a81:<\/p>\n<p>error: Your local changes to the following files would be overwritten by merge:<br \/> &nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;protected\/config\/main.php<br \/> Please, commit your changes or stash them before you can merge.<\/p>\n<p>\u5982\u679c\u5e0c\u671b\u4fdd\u7559\u751f\u4ea7\u670d\u52a1\u5668\u4e0a\u6240\u505a\u7684\u6539\u52a8,\u4ec5\u4ec5\u5e76\u5165\u65b0\u914d\u7f6e\u9879, \u5904\u7406\u65b9\u6cd5\u5982\u4e0b:<\/p>\n<p>git stashgit pullgit stash pop<\/p>\n<p>\u7136\u540e\u53ef\u4ee5\u4f7f\u7528git diff -w +\u6587\u4ef6\u540d \u6765\u786e\u8ba4\u4ee3\u7801\u81ea\u52a8\u5408\u5e76\u7684\u60c5\u51b5.<\/p>\n<p>\u53cd\u8fc7\u6765,\u5982\u679c\u5e0c\u671b\u7528\u4ee3\u7801\u5e93\u4e2d\u7684\u6587\u4ef6\u5b8c\u5168\u8986\u76d6\u672c\u5730\u5de5\u4f5c\u7248\u672c. \u65b9\u6cd5\u5982\u4e0b:<\/p>\n<p>git reset --hardgit pull<\/p>\n<p>\u5176\u4e2dgit reset\u662f\u9488\u5bf9\u7248\u672c,\u5982\u679c\u60f3\u9488\u5bf9\u6587\u4ef6\u56de\u9000\u672c\u5730\u4fee\u6539,\u4f7f\u7528<\/p>\n<pre>\n \n <ol>\n  \n  <li><span><span>git&nbsp;checkout&nbsp;HEAD&nbsp;file\/to\/restore&nbsp; <br><\/span><\/span><\/li>\n \n <\/ol><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\u5982\u679c\u7cfb\u7edf\u4e2d\u6709\u4e00\u4e9b\u914d\u7f6e\u6587\u4ef6\u5728\u670d\u52a1\u5668\u4e0a\u505a\u4e86\u914d\u7f6e\u4fee\u6539,\u7136\u540e\u540e\u7eed\u5f00\u53d1\u53c8\u65b0\u6dfb\u52a0\u4e00\u4e9b\u914d\u7f6e\u9879\u7684\u65f6\u5019, \u5728\u53d1\u5e03\u8fd9\u4e2a\u914d\u7f6e\u6587\u4ef6\u7684\u65f6 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[195111],"tags":[],"class_list":["post-206773","post","type-post","status-publish","format-standard","hentry","category-android"],"_links":{"self":[{"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/posts\/206773","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/comments?post=206773"}],"version-history":[{"count":0,"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/posts\/206773\/revisions"}],"wp:attachment":[{"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/media?parent=206773"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/categories?post=206773"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/tags?post=206773"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}