git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: AndyAo <zen96285@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: How to disable Git from automatically identifying and managing embedded git repositories?
Date: Tue, 01 Jun 2021 10:33:10 +0900	[thread overview]
Message-ID: <xmqqczt6v06h.fsf@gitster.g> (raw)
In-Reply-To: <c4d32a7b-94c5-b613-ae5e-9c18b1ffa627@gmail.com> (AndyAo's message of "Tue, 1 Jun 2021 08:26:54 +0800")

AndyAo <zen96285@gmail.com> writes:

> 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).

      reply	other threads:[~2021-06-01  1:33 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-01  0:26 How to disable Git from automatically identifying and managing embedded git repositories? AndyAo
2021-06-01  1:33 ` Junio C Hamano [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=xmqqczt6v06h.fsf@gitster.g \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=zen96285@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).