{"id":1362,"date":"2024-08-07T20:50:54","date_gmt":"2024-08-07T12:50:54","guid":{"rendered":"http:\/\/codermr.com\/?p=1362"},"modified":"2024-08-07T20:50:55","modified_gmt":"2024-08-07T12:50:55","slug":"git-%e4%b8%ad-index-%e5%92%8c-working-tree-%e7%9a%84%e5%8c%ba%e5%88%ab","status":"publish","type":"post","link":"http:\/\/codermr.com\/index.php\/2024\/08\/07\/git-%e4%b8%ad-index-%e5%92%8c-working-tree-%e7%9a%84%e5%8c%ba%e5%88%ab\/","title":{"rendered":"Git \u4e2d index \u548c working tree \u7684\u533a\u522b"},"content":{"rendered":"\n<h1 class=\"wp-block-heading\">working tree<\/h1>\n\n\n\n<p>working tree \uff0c\u4e5f\u53eb\u505a working directory\uff0c\u662f\u5de5\u4f5c\u76ee\u5f55\uff0c\u4f60\u5c31\u662f\u5728\u8fd9\u4e2a\u5de5\u4f5c\u76ee\u5f55\u4e2d\u8fdb\u884c\u6587\u4ef6\u6dfb\u52a0\u6216\u6539\u52a8\u3002==\u300b\u662f\u4e0d\u662f\u611f\u89c9\u8fd8\u662f\u89e3\u91ca\u7684\u4e0d\u591f\u6e05\u6670\uff1f\u5176\u5b9e working tree \u5c31\u662f\u4f60\u5f53\u524d\u9879\u76ee\u4e2d\uff0c\u6ca1\u6709\u88ab git \u7ba1\u7406\u7684\u6587\u4ef6\u3002\u6bd4\u5982\u4f60\u65b0\u589e\u4e86\u4e00\u4e2a\u6587\u4ef6\u3001\u4fee\u6539\u4e86\u4e00\u4e2a\u6587\u4ef6\u6240\u6539\u52a8\u7684\u90e8\u5206\uff0c\u53ea\u8981\u6ca1\u6709\u7528 git add . \u6dfb\u52a0\u5230 git \u4e2d\uff0c\u90fd\u5c5e\u4e8e working tree \u4e2d\u7684\u6587\u4ef6\u3002<strong>These changes are not yet tracked by Git until you add them to the index<\/strong>.<\/p>\n\n\n\n<h1 class=\"wp-block-heading\">index <\/h1>\n\n\n\n<p>index \u662f\u4ec0\u4e48\u610f\u601d\u5462\uff0c\u7b80\u800c\u8a00\u4e4b\uff0c\u5c31\u662f\u4f60 git add . \u4e86\u4f46\u662f\u8fd8\u6ca1\u6709 commit \u7684\u6587\u4ef6\uff0c\u591f\u6e05\u6670\u4e86\u5427\u3002\u8fd9\u4e9b\u6587\u4ef6\u5373\u5c06\u88ab\u63d0\u4ea4\uff08\u7b49\u4f60\u7684 commit \u547d\u4ee4\uff09\uff0cindex  is an intermediate area where Git holds changes that are about to be committed\uff0cWhen you use the git add command, you add changes from the working tree to the index\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>working tree working tree \uff0c\u4e5f\u53eb\u505a working directory\uff0c\u662f\u5de5\u4f5c\u76ee\u5f55\uff0c&#8230;<\/p>\n","protected":false},"author":1,"featured_media":996,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1,52],"tags":[63],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.1 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Git \u4e2d index \u548c working tree \u7684\u533a\u522b - \u7801\u5148\u751f\u7684\u535a\u5ba2<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"http:\/\/codermr.com\/index.php\/2024\/08\/07\/git-\u4e2d-index-\u548c-working-tree-\u7684\u533a\u522b\/\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Git \u4e2d index \u548c working tree \u7684\u533a\u522b - \u7801\u5148\u751f\u7684\u535a\u5ba2\" \/>\n<meta property=\"og:description\" content=\"working tree working tree \uff0c\u4e5f\u53eb\u505a working directory\uff0c\u662f\u5de5\u4f5c\u76ee\u5f55\uff0c...\" \/>\n<meta property=\"og:url\" content=\"http:\/\/codermr.com\/index.php\/2024\/08\/07\/git-\u4e2d-index-\u548c-working-tree-\u7684\u533a\u522b\/\" \/>\n<meta property=\"og:site_name\" content=\"\u7801\u5148\u751f\u7684\u535a\u5ba2\" \/>\n<meta property=\"article:published_time\" content=\"2024-08-07T12:50:54+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-08-07T12:50:55+00:00\" \/>\n<meta property=\"og:image\" content=\"http:\/\/codermr.com\/wp-content\/uploads\/2023\/04\/git_commnd1.png\" \/>\n\t<meta property=\"og:image:width\" content=\"137\" \/>\n\t<meta property=\"og:image:height\" content=\"136\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"\u7801\u5148\u751f\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@https:\/\/twitter.com\/mrcode2021\" \/>\n<meta name=\"twitter:site\" content=\"@mrcode2021\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"\u7801\u5148\u751f\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"http:\/\/codermr.com\/index.php\/2024\/08\/07\/git-%e4%b8%ad-index-%e5%92%8c-working-tree-%e7%9a%84%e5%8c%ba%e5%88%ab\/#article\",\"isPartOf\":{\"@id\":\"http:\/\/codermr.com\/index.php\/2024\/08\/07\/git-%e4%b8%ad-index-%e5%92%8c-working-tree-%e7%9a%84%e5%8c%ba%e5%88%ab\/\"},\"author\":{\"name\":\"\u7801\u5148\u751f\",\"@id\":\"http:\/\/codermr.com\/#\/schema\/person\/39016e15c79e4f02d1ed3a64688619bf\"},\"headline\":\"Git \u4e2d index \u548c working tree \u7684\u533a\u522b\",\"datePublished\":\"2024-08-07T12:50:54+00:00\",\"dateModified\":\"2024-08-07T12:50:55+00:00\",\"mainEntityOfPage\":{\"@id\":\"http:\/\/codermr.com\/index.php\/2024\/08\/07\/git-%e4%b8%ad-index-%e5%92%8c-working-tree-%e7%9a%84%e5%8c%ba%e5%88%ab\/\"},\"wordCount\":71,\"commentCount\":0,\"publisher\":{\"@id\":\"http:\/\/codermr.com\/#\/schema\/person\/39016e15c79e4f02d1ed3a64688619bf\"},\"keywords\":[\"git\"],\"articleSection\":[\"JAVA\",\"\u7f16\u7a0b\u5de5\u5177\"],\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"http:\/\/codermr.com\/index.php\/2024\/08\/07\/git-%e4%b8%ad-index-%e5%92%8c-working-tree-%e7%9a%84%e5%8c%ba%e5%88%ab\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"http:\/\/codermr.com\/index.php\/2024\/08\/07\/git-%e4%b8%ad-index-%e5%92%8c-working-tree-%e7%9a%84%e5%8c%ba%e5%88%ab\/\",\"url\":\"http:\/\/codermr.com\/index.php\/2024\/08\/07\/git-%e4%b8%ad-index-%e5%92%8c-working-tree-%e7%9a%84%e5%8c%ba%e5%88%ab\/\",\"name\":\"Git \u4e2d index \u548c working tree \u7684\u533a\u522b - \u7801\u5148\u751f\u7684\u535a\u5ba2\",\"isPartOf\":{\"@id\":\"http:\/\/codermr.com\/#website\"},\"datePublished\":\"2024-08-07T12:50:54+00:00\",\"dateModified\":\"2024-08-07T12:50:55+00:00\",\"breadcrumb\":{\"@id\":\"http:\/\/codermr.com\/index.php\/2024\/08\/07\/git-%e4%b8%ad-index-%e5%92%8c-working-tree-%e7%9a%84%e5%8c%ba%e5%88%ab\/#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"http:\/\/codermr.com\/index.php\/2024\/08\/07\/git-%e4%b8%ad-index-%e5%92%8c-working-tree-%e7%9a%84%e5%8c%ba%e5%88%ab\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"http:\/\/codermr.com\/index.php\/2024\/08\/07\/git-%e4%b8%ad-index-%e5%92%8c-working-tree-%e7%9a%84%e5%8c%ba%e5%88%ab\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"http:\/\/codermr.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Git \u4e2d index \u548c working tree \u7684\u533a\u522b\"}]},{\"@type\":\"WebSite\",\"@id\":\"http:\/\/codermr.com\/#website\",\"url\":\"http:\/\/codermr.com\/\",\"name\":\"\u7801\u5148\u751f\u7684\u535a\u5ba2\",\"description\":\"\u6b22 \u8fce \u4e0b \u8f7d \u6211 \u5f00 \u53d1 \u7684 \u5404 \u7aef \u8f6f \u4ef6 \u548c APP\",\"publisher\":{\"@id\":\"http:\/\/codermr.com\/#\/schema\/person\/39016e15c79e4f02d1ed3a64688619bf\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"http:\/\/codermr.com\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"zh-Hans\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"http:\/\/codermr.com\/#\/schema\/person\/39016e15c79e4f02d1ed3a64688619bf\",\"name\":\"\u7801\u5148\u751f\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"http:\/\/codermr.com\/#\/schema\/person\/image\/\",\"url\":\"http:\/\/codermr.com\/wp-content\/uploads\/2023\/02\/wukong.jpg\",\"contentUrl\":\"http:\/\/codermr.com\/wp-content\/uploads\/2023\/02\/wukong.jpg\",\"width\":400,\"height\":400,\"caption\":\"\u7801\u5148\u751f\"},\"logo\":{\"@id\":\"http:\/\/codermr.com\/#\/schema\/person\/image\/\"},\"sameAs\":[\"http:\/\/codermr.com\",\"https:\/\/twitter.com\/https:\/\/twitter.com\/mrcode2021\"],\"url\":\"http:\/\/codermr.com\/index.php\/author\/coderma\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Git \u4e2d index \u548c working tree \u7684\u533a\u522b - \u7801\u5148\u751f\u7684\u535a\u5ba2","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"http:\/\/codermr.com\/index.php\/2024\/08\/07\/git-\u4e2d-index-\u548c-working-tree-\u7684\u533a\u522b\/","og_locale":"zh_CN","og_type":"article","og_title":"Git \u4e2d index \u548c working tree \u7684\u533a\u522b - \u7801\u5148\u751f\u7684\u535a\u5ba2","og_description":"working tree working tree \uff0c\u4e5f\u53eb\u505a working directory\uff0c\u662f\u5de5\u4f5c\u76ee\u5f55\uff0c...","og_url":"http:\/\/codermr.com\/index.php\/2024\/08\/07\/git-\u4e2d-index-\u548c-working-tree-\u7684\u533a\u522b\/","og_site_name":"\u7801\u5148\u751f\u7684\u535a\u5ba2","article_published_time":"2024-08-07T12:50:54+00:00","article_modified_time":"2024-08-07T12:50:55+00:00","og_image":[{"width":137,"height":136,"url":"http:\/\/codermr.com\/wp-content\/uploads\/2023\/04\/git_commnd1.png","type":"image\/png"}],"author":"\u7801\u5148\u751f","twitter_card":"summary_large_image","twitter_creator":"@https:\/\/twitter.com\/mrcode2021","twitter_site":"@mrcode2021","twitter_misc":{"\u4f5c\u8005":"\u7801\u5148\u751f","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"1 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"http:\/\/codermr.com\/index.php\/2024\/08\/07\/git-%e4%b8%ad-index-%e5%92%8c-working-tree-%e7%9a%84%e5%8c%ba%e5%88%ab\/#article","isPartOf":{"@id":"http:\/\/codermr.com\/index.php\/2024\/08\/07\/git-%e4%b8%ad-index-%e5%92%8c-working-tree-%e7%9a%84%e5%8c%ba%e5%88%ab\/"},"author":{"name":"\u7801\u5148\u751f","@id":"http:\/\/codermr.com\/#\/schema\/person\/39016e15c79e4f02d1ed3a64688619bf"},"headline":"Git \u4e2d index \u548c working tree \u7684\u533a\u522b","datePublished":"2024-08-07T12:50:54+00:00","dateModified":"2024-08-07T12:50:55+00:00","mainEntityOfPage":{"@id":"http:\/\/codermr.com\/index.php\/2024\/08\/07\/git-%e4%b8%ad-index-%e5%92%8c-working-tree-%e7%9a%84%e5%8c%ba%e5%88%ab\/"},"wordCount":71,"commentCount":0,"publisher":{"@id":"http:\/\/codermr.com\/#\/schema\/person\/39016e15c79e4f02d1ed3a64688619bf"},"keywords":["git"],"articleSection":["JAVA","\u7f16\u7a0b\u5de5\u5177"],"inLanguage":"zh-Hans","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["http:\/\/codermr.com\/index.php\/2024\/08\/07\/git-%e4%b8%ad-index-%e5%92%8c-working-tree-%e7%9a%84%e5%8c%ba%e5%88%ab\/#respond"]}]},{"@type":"WebPage","@id":"http:\/\/codermr.com\/index.php\/2024\/08\/07\/git-%e4%b8%ad-index-%e5%92%8c-working-tree-%e7%9a%84%e5%8c%ba%e5%88%ab\/","url":"http:\/\/codermr.com\/index.php\/2024\/08\/07\/git-%e4%b8%ad-index-%e5%92%8c-working-tree-%e7%9a%84%e5%8c%ba%e5%88%ab\/","name":"Git \u4e2d index \u548c working tree \u7684\u533a\u522b - \u7801\u5148\u751f\u7684\u535a\u5ba2","isPartOf":{"@id":"http:\/\/codermr.com\/#website"},"datePublished":"2024-08-07T12:50:54+00:00","dateModified":"2024-08-07T12:50:55+00:00","breadcrumb":{"@id":"http:\/\/codermr.com\/index.php\/2024\/08\/07\/git-%e4%b8%ad-index-%e5%92%8c-working-tree-%e7%9a%84%e5%8c%ba%e5%88%ab\/#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["http:\/\/codermr.com\/index.php\/2024\/08\/07\/git-%e4%b8%ad-index-%e5%92%8c-working-tree-%e7%9a%84%e5%8c%ba%e5%88%ab\/"]}]},{"@type":"BreadcrumbList","@id":"http:\/\/codermr.com\/index.php\/2024\/08\/07\/git-%e4%b8%ad-index-%e5%92%8c-working-tree-%e7%9a%84%e5%8c%ba%e5%88%ab\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"http:\/\/codermr.com\/"},{"@type":"ListItem","position":2,"name":"Git \u4e2d index \u548c working tree \u7684\u533a\u522b"}]},{"@type":"WebSite","@id":"http:\/\/codermr.com\/#website","url":"http:\/\/codermr.com\/","name":"\u7801\u5148\u751f\u7684\u535a\u5ba2","description":"\u6b22 \u8fce \u4e0b \u8f7d \u6211 \u5f00 \u53d1 \u7684 \u5404 \u7aef \u8f6f \u4ef6 \u548c APP","publisher":{"@id":"http:\/\/codermr.com\/#\/schema\/person\/39016e15c79e4f02d1ed3a64688619bf"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"http:\/\/codermr.com\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"zh-Hans"},{"@type":["Person","Organization"],"@id":"http:\/\/codermr.com\/#\/schema\/person\/39016e15c79e4f02d1ed3a64688619bf","name":"\u7801\u5148\u751f","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"http:\/\/codermr.com\/#\/schema\/person\/image\/","url":"http:\/\/codermr.com\/wp-content\/uploads\/2023\/02\/wukong.jpg","contentUrl":"http:\/\/codermr.com\/wp-content\/uploads\/2023\/02\/wukong.jpg","width":400,"height":400,"caption":"\u7801\u5148\u751f"},"logo":{"@id":"http:\/\/codermr.com\/#\/schema\/person\/image\/"},"sameAs":["http:\/\/codermr.com","https:\/\/twitter.com\/https:\/\/twitter.com\/mrcode2021"],"url":"http:\/\/codermr.com\/index.php\/author\/coderma\/"}]}},"_links":{"self":[{"href":"http:\/\/codermr.com\/index.php\/wp-json\/wp\/v2\/posts\/1362"}],"collection":[{"href":"http:\/\/codermr.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/codermr.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/codermr.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/codermr.com\/index.php\/wp-json\/wp\/v2\/comments?post=1362"}],"version-history":[{"count":2,"href":"http:\/\/codermr.com\/index.php\/wp-json\/wp\/v2\/posts\/1362\/revisions"}],"predecessor-version":[{"id":1364,"href":"http:\/\/codermr.com\/index.php\/wp-json\/wp\/v2\/posts\/1362\/revisions\/1364"}],"wp:featuredmedia":[{"embeddable":true,"href":"http:\/\/codermr.com\/index.php\/wp-json\/wp\/v2\/media\/996"}],"wp:attachment":[{"href":"http:\/\/codermr.com\/index.php\/wp-json\/wp\/v2\/media?parent=1362"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/codermr.com\/index.php\/wp-json\/wp\/v2\/categories?post=1362"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/codermr.com\/index.php\/wp-json\/wp\/v2\/tags?post=1362"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}