{"thread":{"id":"55813","subject":"How to disable Git from automatically identifying and managing embedded git repositories?","startedAt":"2021-06-01T00:27:04Z","lastAt":"2021-06-01T01:33:16Z","messageCount":2,"participants":["AndyAo","Junio C Hamano"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"426086","messageId":"c4d32a7b-94c5-b613-ae5e-9c18b1ffa627@gmail.com","threadId":"55813","inReplyTo":null,"subject":"How to disable Git from automatically identifying and managing embedded git repositories?","fromName":"AndyAo","fromEmail":"zen96285@gmail.com","sentAt":"2021-06-01T00:26:54Z","receivedAt":"2021-06-01T00:27:04Z","isPatch":false,"sender":{"key":"zen96285@gmail.com","avatar":null},"body":"When I upgraded Git from 2.24.1.windows.2 to 2.29.2.windows.2, I noticed \nthat the embedded git repository is recognized in `git status`, and if I \nuse `git add .` will manage the embedded git repository directly as a \nsubmodule, instead of just ignoring them, which is the behavior I want.\n\nHow do I turn this off?\n\nThanks.\n\n"},{"id":"426090","messageId":"xmqqczt6v06h.fsf@gitster.g","threadId":"55813","inReplyTo":"c4d32a7b-94c5-b613-ae5e-9c18b1ffa627@gmail.com","subject":"Re: How to disable Git from automatically identifying and managing embedded git repositories?","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2021-06-01T01:33:10Z","receivedAt":"2021-06-01T01:33:16Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"AndyAo <zen96285@gmail.com> writes:\n\n> When I upgraded Git from 2.24.1.windows.2 to 2.29.2.windows.2, I\n> noticed that the embedded git repository is recognized in `git\n> status`, and if I use `git add .` will manage the embedded git\n> repository directly as a submodule, instead of just ignoring them,\n> which is the behavior I want.\n>\n> How do I turn this off?\n\nYou can use the ignore mechanism to exclude it and \"git add .\" would\nnot touch it.\n\nIn my checkout of the git repository, I have a separate copy of the\nsame git repository and checked out at the path \"Meta/\".  In the\nupper-level repository, I have \"/Meta\" in .git/info/exclude (among\nother private-ignore patterns), and that would keep it out of the\nmain repository's index even with \"git add .\" (not that I'd ever use\n\"add everything\", which I do not think have any place in my\nworkflow).  This is done without using .gitignore because it is\nnobody else's business that I use such a \"strange\" setup and use the\npathname \"Meta/\" for it (hence project participants do not have to\nknow about it).\n"}]}