{"id":5700,"date":"2024-06-05T18:51:45","date_gmt":"2024-06-05T10:51:45","guid":{"rendered":"http:\/\/blog.coolcoding.cn\/?p=5700"},"modified":"2024-06-06T11:28:04","modified_gmt":"2024-06-06T03:28:04","slug":"git%e6%9c%ac%e5%9c%b0%e5%bf%bd%e7%95%a5windows","status":"publish","type":"post","link":"https:\/\/blog.coolcoding.cn\/?p=5700","title":{"rendered":"git\u7684\u672c\u5730\u6587\u4ef6\u5ffd\u7565\u529f\u80fd"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\">\u9700\u6c42<\/h2>\n\n\n\n<p>git\u7ba1\u7406\u4e0b\u7684\u67d0\u4e9b\u6587\u4ef6\u6216\u8005\u76ee\u5f55\uff0c\u8981\u672c\u5730\u5220\u4e86\u5b83\uff0c\u5e76\u4e14\u5ffd\u7565\u5b83<\/p>\n\n\n\n<p>1\u3001\u4f7f\u7528.gitignore\u4f1a\u5f71\u54cd\u5176\u5b83\u4eba<\/p>\n\n\n\n<p>2\u3001\u5bf9\u4e8e\u5df2\u4e0a\u4f20\uff08\u8ffd\u8e2a\uff09\u7684\u6587\u4ef6\uff0c\u4f7f\u7528.gitignore\u662f\u65e0\u6548\u7684<\/p>\n\n\n\n<p>3\u3001\u5bf9\u4e8e\u5df2\u4e0a\u4f20\uff08\u8ffd\u8e2a\uff09\u7684\u6587\u4ef6\uff0c\u4f7f\u7528skip-worktree\u662f\u65e0\u6548\u7684<\/p>\n\n\n\n<p><strong>\u6240\u4ee5\u53ef\u4ee5\u4f7f\u7528assume-unchanged\u529f\u80fd<\/strong><\/p>\n\n\n\n<p><\/p>\n\n\n\n<p>\u4ee5\u4e0b\u547d\u4ee4\u4e3alinux\u7248\u672c\uff0c\u5982\u679c\u662fwindows\u7cfb\u7edf\uff0c\u53f3\u952e\u83dc\u5355Open Git Bash here\u4ea6\u53ef<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"341\" height=\"374\" src=\"http:\/\/blog.coolcoding.cn\/wp-content\/uploads\/2024\/06\/image.png\" alt=\"\" class=\"wp-image-5713\" srcset=\"https:\/\/blog.coolcoding.cn\/wp-content\/uploads\/2024\/06\/image.png 341w, https:\/\/blog.coolcoding.cn\/wp-content\/uploads\/2024\/06\/image-82x90.png 82w\" sizes=\"(max-width: 341px) 100vw, 341px\" \/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">update-index\u547d\u4ee4<\/h2>\n\n\n\n<p>\u5728git\u6839\u76ee\u5f55\uff0c\u7528bash\u6253\u5f00\u547d\u4ee4\u884c\uff0c\u53ef\u4ee5\u6267\u884c\u76f8\u5e94\u7684git\u547d\u4ee4<\/p>\n\n\n\n<p>git\u7684update-index\u9009\u9879\u8bf4\u660e\uff1a <\/p>\n\n\n\n<p>&#8211;assume-unchanged  \u672c\u5730\u5ffd\u7565,\u505c\u6b62\u6587\u4ef6\u8ffd\u8e2a<\/p>\n\n\n\n<p>&#8211;no-assume-unchanged  \u64a4\u9500\u5ffd\u7565<\/p>\n\n\n\n<p>&#8211;really-refresh  \u5237\u65b0,\u65e0\u89c6assume-unchanged<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u5ffd\u7565\u6587\u4ef6<\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code>git update-index --assume-unchanged Assets\/tmp.txt<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">\u4e0d\u5ffd\u7565\u6587\u4ef6<\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code>git update-index --no-assume-unchanged Assets\/tmp.txt<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">\u5ffd\u7565\u76ee\u5f55<\/h2>\n\n\n\n<p>&#8211;assume-unchanged\u53ea\u80fd\u5ffd\u7565\u6587\u4ef6\uff0c\u6240\u4ee5\u9700\u8981\u9012\u5f52\u6b64\u76ee\u5f55\u6240\u6709\u6587\u4ef6<\/p>\n\n\n\n<p>\u5728bash\u4e2dcd\u5230\u76ee\u5f55\uff0c\u7136\u540e<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>git ls-files -z | xargs -0 git update-index --assume-unchanged<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">\u4e0d\u5ffd\u7565\u76ee\u5f55<\/h2>\n\n\n\n<p>\u5982\u679c\u6587\u4ef6\u5df2\u7ecf\u88ab\u5220\u4e86\uff0c\u4f7f\u7528shell\u7684ls\u547d\u4ee4\u662f\u65e0\u6cd5\u83b7\u5f97\u6587\u4ef6\u540d\u7684\uff0c\u6240\u4ee5\u9700\u8981\u5148really-refresh<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\u5148\u770b\u4e00\u4e0breally-refresh\ngit update-index --really-refresh\n\u8f93\u51fa\u4e86 Assets\/UXTools\/Res\/UX-GUI\/Res\/Fonts.meta: needs update\n\u9700\u8981\u622a\u53d6: needs update\u524d\u9762\u7684\u6587\u4ef6\u540d\u8fdb\u884c\u547d\u4ee4\u884c\u6062\u590d<\/code><\/pre>\n\n\n\n<p>\u6267\u884c\u4ee5\u4e0b\u547d\u4ee4\u5373\u53ef\u9012\u5f52\u4e0d\u5ffd\u7565\u6240\u6709\u6587\u4ef6<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>git update-index --really-refresh | awk -F ':' '{print $1}' | xargs git update-index --no-assume-unchanged<\/code><\/pre>\n\n\n\n<p>awk\u8bf4\u660e<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>-F ':' \u4e3a\u6307\u5b9a:\u4f5c\u4e3a\u5206\u9694\u7b26\n$1 \u4e3a\u7b2c1\u4e2a\u622a\u53d6\u53c2\u6570\n'{print $1}' \u4e3a\u6253\u5370\u7b2c1\u4e2a\u53c2\u6570<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>\u4e5f\u53ef\u4ee5\u6dfb\u52a0\u8fc7\u6ee4\u6761\u4ef6\ngit update-index --really-refresh | grep Assets\/MyEditor\/ | awk -F ':' '{print $1}' | xargs git update-index --no-assume-unchanged<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\u9700\u6c42 git\u7ba1\u7406\u4e0b\u7684\u67d0\u4e9b\u6587\u4ef6\u6216\u8005\u76ee\u5f55\uff0c\u8981\u672c\u5730\u5220\u4e86\u5b83\uff0c\u5e76\u4e14\u5ffd\u7565\u5b83 1\u3001\u4f7f\u7528.gitignore\u4f1a\u5f71\u54cd\u5176\u5b83\u4eba 2\u3001 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"_links":{"self":[{"href":"https:\/\/blog.coolcoding.cn\/index.php?rest_route=\/wp\/v2\/posts\/5700"}],"collection":[{"href":"https:\/\/blog.coolcoding.cn\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.coolcoding.cn\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.coolcoding.cn\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.coolcoding.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=5700"}],"version-history":[{"count":17,"href":"https:\/\/blog.coolcoding.cn\/index.php?rest_route=\/wp\/v2\/posts\/5700\/revisions"}],"predecessor-version":[{"id":5723,"href":"https:\/\/blog.coolcoding.cn\/index.php?rest_route=\/wp\/v2\/posts\/5700\/revisions\/5723"}],"wp:attachment":[{"href":"https:\/\/blog.coolcoding.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=5700"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.coolcoding.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=5700"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.coolcoding.cn\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=5700"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}