{"id":343,"date":"2019-04-28T11:23:17","date_gmt":"2019-04-28T03:23:17","guid":{"rendered":"https:\/\/qtvz.com\/?p=343"},"modified":"2019-04-28T11:23:18","modified_gmt":"2019-04-28T03:23:18","slug":"git%e5%a6%82%e4%bd%95%e7%a7%bb%e9%99%a4%e6%9f%90%e6%96%87%e4%bb%b6%e7%9a%84%e7%89%88%e6%9c%ac%e6%8e%a7%e5%88%b6","status":"publish","type":"post","link":"https:\/\/qtvz.com\/343.html","title":{"rendered":"Git\u5982\u4f55\u79fb\u9664\u67d0\u6587\u4ef6\u7684\u7248\u672c\u63a7\u5236"},"content":{"rendered":"<!--wp-compress-html--><!--wp-compress-html no compression-->\n<p> \u7a81\u7136\u53d1\u73b0\u539f\u6765\u00a0<code>lib<\/code>\u00a0\u76ee\u5f55\u4e0d\u9700\u8981\u63d0\u4ea4\u5230\u7248\u672c\u5e93,\u4f46\u662f\u73b0\u5728\u8fdc\u7a0b\u5df2\u7ecf\u5b58\u5728\u8be5\u76ee\u5f55 <\/p>\n\n\n\n<h2><code>git rm<\/code>\u00a0\u547d\u4ee4\u53c2\u6570<\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code>-n --dry-run \nDon\u2019t actually remove any file(s). Instead, just show if they exist in the index and would otherwise be removed by the command.\n-r \nAllow recursive removal when a leading directory name is given. \n--cached \nUse this option to unstage and remove paths only from the index. Working tree files, whether modified or not, will be left alone.<\/code><\/pre>\n\n\n\n<h2>\u89e3\u51b3\u65b9\u6cd5<\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code>git rm -r -n --cached \"bin\/\" \/\/-n\uff1a\u52a0\u4e0a\u8fd9\u4e2a\u53c2\u6570\uff0c\u6267\u884c\u547d\u4ee4\u65f6\uff0c\u662f\u4e0d\u4f1a\u5220\u9664\u4efb\u4f55\u6587\u4ef6\uff0c\u800c\u662f\u5c55\u793a\u6b64\u547d\u4ee4\u8981\u5220\u9664\u7684\u6587\u4ef6\u5217\u8868\u9884\u89c8\u3002\ngit rm -r --cached  \"bin\/\"      \/\/\u6700\u7ec8\u6267\u884c\u547d\u4ee4. \ngit commit -m\" remove bin folder all file out of control\"    \/\/\u63d0\u4ea4\ngit push origin master   \/\/\u63d0\u4ea4\u5230\u8fdc\u7a0b\u670d\u52a1\u5668<\/code><\/pre>\n\n\n\n<p>\u6b64\u65f6&nbsp;<code>git status<\/code>&nbsp;\u770b\u5230 bin\/\u76ee\u5f55\u72b6\u6001\u53d8\u4e3a&nbsp;<code>untracked<\/code><\/p>\n\n\n\n<p>\u53ef\u4ee5\u4fee\u6539&nbsp;<code>.gitignore<\/code>&nbsp;\u6587\u4ef6 \u6dfb\u52a0&nbsp;<code>bin\/<\/code>&nbsp;\u5e76\u63d0\u4ea4&nbsp;<code>.gitignore<\/code>&nbsp;\u6587\u4ef6\u5230\u8fdc\u7a0b\u670d\u52a1\u5668,\u8fd9\u6837\u5c31\u53ef\u4ee5\u4e0d\u5bf9bin\u76ee\u5f55\u8fdb\u884c\u7248\u672c\u7ba1\u7406\u4e86\u3002<\/p>\n\n\n\n<p>\u4ee5\u540e\u9700\u8981\u7684\u65f6\u5019,\u53ea\u9700\u8981\u6ce8\u91ca&nbsp;<code>.gitignore<\/code>&nbsp;\u91cc&nbsp;<code>#bin\/<\/code>&nbsp;\u5185\u5bb9,\u91cd\u65b0\u6267\u884c&nbsp;<code>git bin\/<\/code>&nbsp;,\u5373\u53ef\u91cd\u65b0\u7eb3\u5165\u7248\u672c\u7ba1\u7406\u3002<\/p>\n<!--wp-compress-html no compression--><!--wp-compress-html-->","protected":false},"excerpt":{"rendered":"\u7a81\u7136\u53d1\u73b0\u539f\u6765\u00a0lib\u00a0\u76ee\u5f55\u4e0d\u9700\u8981\u63d0\u4ea4\u5230\u7248\u672c\u5e93,\u4f46\u662f\u73b0\u5728\u8fdc\u7a0b\u5df2\u7ecf\u5b58\u5728\u8be5\u76ee\u5f55 git rm\u00a0\u547d\u4ee4\u53c2\u6570 \u89e3\u51b3\u65b9\u6cd5 \u6b64\u65f6&nbsp;git status&nbsp;\u770b\u5230 bin\/\u76ee\u5f55\u72b6\u6001\u53d8\u4e3a&nbsp;unt \u00b7\u00b7\u00b7","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[72],"tags":[75],"views":22148,"_links":{"self":[{"href":"https:\/\/qtvz.com\/api\/wp\/v2\/posts\/343"}],"collection":[{"href":"https:\/\/qtvz.com\/api\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/qtvz.com\/api\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/qtvz.com\/api\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/qtvz.com\/api\/wp\/v2\/comments?post=343"}],"version-history":[{"count":1,"href":"https:\/\/qtvz.com\/api\/wp\/v2\/posts\/343\/revisions"}],"predecessor-version":[{"id":344,"href":"https:\/\/qtvz.com\/api\/wp\/v2\/posts\/343\/revisions\/344"}],"wp:attachment":[{"href":"https:\/\/qtvz.com\/api\/wp\/v2\/media?parent=343"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/qtvz.com\/api\/wp\/v2\/categories?post=343"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/qtvz.com\/api\/wp\/v2\/tags?post=343"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}