{"id":182,"date":"2024-07-12T22:35:36","date_gmt":"2024-07-12T14:35:36","guid":{"rendered":"https:\/\/thereisno.top:4430\/?p=182"},"modified":"2024-07-18T10:31:58","modified_gmt":"2024-07-18T02:31:58","slug":"git-rm%e7%a7%bb%e9%99%a4%e7%89%88%e6%9c%ac%e7%ae%a1%e7%90%86","status":"publish","type":"post","link":"https:\/\/thereisno.top\/?p=182","title":{"rendered":"git rm\u79fb\u9664\u7248\u672c\u7ba1\u7406"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">git rm\u4e0egit rm &#8211;cached<br>\n\u5f53\u6211\u4eec\u9700\u8981\u5220\u9664\u6682\u5b58\u533a\u6216\u5206\u652f\u4e0a\u7684\u6587\u4ef6, \u540c\u65f6\u5de5\u4f5c\u533a\u4e5f\u4e0d\u9700\u8981\u8fd9\u4e2a\u6587\u4ef6\u4e86, \u53ef\u4ee5\u4f7f\u7528<br>\n1 git rm file_path<br>\n2 git commit -m &#8216;delete somefile&#8217;<br>\n3 git push<br>\n\u5f53\u6211\u4eec\u9700\u8981\u5220\u9664\u6682\u5b58\u533a\u6216\u5206\u652f\u4e0a\u7684\u6587\u4ef6, \u4f46\u672c\u5730\u53c8\u9700\u8981\u4f7f\u7528, \u53ea\u662f\u4e0d\u5e0c\u671b\u8fd9\u4e2a\u6587\u4ef6\u88ab\u7248\u672c\u63a7\u5236, \u53ef\u4ee5\u4f7f\u7528<br>\ngit rm &#8211;cached file_path  \/\/\u6ca1\u6709add\u64cd\u4f5c\uff0c\u5176\u4ed6\u7528\u6237pull\u4f1a\u5220\u9664<br>\ngit commit -m &#8216;delete remote somefile&#8217;<br>\ngit push<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u5220\u9664\u7248\u672c\u63a7\u5236push\u4e4b\u540e\u4f1a\u5220\u9664\u4ed3\u5e93\u7684\u6587\u4ef6\uff0c\u5176\u4ed6\u7528\u6237pull \u65f6\u4e5f\u4f1a\u5220\u9664\uff0c\u5176\u4ed6\u7528\u6237\u5728pull\u4e4b\u524d\u5e94\u8be5\u5148\u5907\u4efd\u8981\u5220\u9664\u7684\u6587\u4ef6\uff0c\u7136\u540e\u518dpull\uff0c\u5408\u5e76\u4e4b\u540e\u518d\u628a\u6587\u4ef6\u8fd8\u539f\u56de\u6765<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">git rm &#8211;f  &#8220;\u6587\u4ef6\u8def\u5f84&#8221;\uff0c\u4e0d\u4ec5\u5c06\u8be5\u6587\u4ef6\u4ece\u7f13\u5b58\u4e2d\u5220\u9664\uff0c\u8fd8\u4f1a\u5c06\u7269\u7406\u6587\u4ef6\u5220\u9664\uff08\u4e0d\u4f1a\u56de\u6536\u5230\u5783\u573e\u6876\uff09<\/p>\n","protected":false},"excerpt":{"rendered":"<p>git rm\u4e0egit rm &#8211;cached \u5f53\u6211\u4eec\u9700\u8981\u5220\u9664\u6682\u5b58\u533a\u6216\u5206\u652f\u4e0a\u7684\u6587\u4ef6, \u540c\u65f6\u5de5\u4f5c\u533a\u4e5f\u4e0d\u9700 &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/thereisno.top\/?p=182\" class=\"more-link\">\u7ee7\u7eed\u9605\u8bfb<span class=\"screen-reader-text\">\u201cgit rm\u79fb\u9664\u7248\u672c\u7ba1\u7406\u201d<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[15],"tags":[49],"class_list":["post-182","post","type-post","status-publish","format-standard","hentry","category-git","tag-git-rm"],"_links":{"self":[{"href":"https:\/\/thereisno.top\/index.php?rest_route=\/wp\/v2\/posts\/182","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/thereisno.top\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/thereisno.top\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/thereisno.top\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/thereisno.top\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=182"}],"version-history":[{"count":1,"href":"https:\/\/thereisno.top\/index.php?rest_route=\/wp\/v2\/posts\/182\/revisions"}],"predecessor-version":[{"id":183,"href":"https:\/\/thereisno.top\/index.php?rest_route=\/wp\/v2\/posts\/182\/revisions\/183"}],"wp:attachment":[{"href":"https:\/\/thereisno.top\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=182"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/thereisno.top\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=182"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/thereisno.top\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=182"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}