git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: How to disable Git from automatically identifying and managing embedded git repositories?

From
Junio C Hamano <gitster@pobox.com>
Date
Jun 1, 2021, 01:33 UTC
Message-ID
<xmqqczt6v06h.fsf@gitster.g>
In-Reply-To
<c4d32a7b-94c5-b613-ae5e-9c18b1ffa627@gmail.com>
AndyAo <zen96285@gmail.com> writes:
Show 7 quoted lines
> When I upgraded Git from 2.24.1.windows.2 to 2.29.2.windows.2, I
> noticed that the embedded git repository is recognized in `git
> status`, and if I use `git add .` will manage the embedded git
> repository directly as a submodule, instead of just ignoring them,
> which is the behavior I want.
>
> How do I turn this off?

You can use the ignore mechanism to exclude it and "git add ." would not touch it.

In my checkout of the git repository, I have a separate copy of the same git repository and checked out at the path "Meta/". In the upper-level repository, I have "/Meta" in .git/info/exclude (among other private-ignore patterns), and that would keep it out of the main repository's index even with "git add ." (not that I'd ever use "add everything", which I do not think have any place in my workflow). This is done without using .gitignore because it is nobody else's business that I use such a "strange" setup and use the pathname "Meta/" for it (hence project participants do not have to know about it).

Previous: AndyAo
Message 2 of 2 in “How to disable Git from automatically identifying and managing embedded git repositories?”
  1. AndyAoJun 1, 2021
  2. Junio C HamanoJun 1, 2021

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.