git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Jeff King <peff@peff.net>
To: Alexander Mills <alexander.d.mills@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: add/init all git submodules that are referenced in .gitmodules
Date: Wed, 6 Oct 2021 15:28:35 -0400	[thread overview]
Message-ID: <YV3444Bvvfzp37Di@coredump.intra.peff.net> (raw)
In-Reply-To: <CA+KyZp75fjj9T0LjkpEjLMVf5KNguNZ1Ycxbb26ZnCGrK5zLAQ@mail.gmail.com>

On Tue, Oct 05, 2021 at 04:52:00PM -0700, Alexander Mills wrote:

> I am looking for this feature:
> 
> https://stackoverflow.com/a/69458406/1223975
> 
> it is really confusing as to why it doesn't exist

I'm not sure I understand what is being asked for.

If you just want to initialize and populate all of the modules in
.gitmodules (which is what I thought your subject line was asking for),
then:

  git submodule update --init

will do that (though of course if you are cloning anyway, you can just
say "--recurse-submodules).

But reading the original SO question, it is about finding repositories
in the current directory that _aren't_ submodules, and then adding them.
But those ones wouldn't be referenced in .gitmodules.

For that problem, no, I don't think there's an easy command, and you
have to dig for them (though "git ls-files -o --exclude-standard" is
perhaps a good way to locate them). But it's also not something I'd
expect to be a very common operation, which is why there's not an
existing command to do it.

-Peff

      reply	other threads:[~2021-10-06 19:28 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-05 23:52 add/init all git submodules that are referenced in .gitmodules Alexander Mills
2021-10-06 19:28 ` Jeff King [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

  List information: http://vger.kernel.org/majordomo-info.html

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

  git send-email \
    --in-reply-to=YV3444Bvvfzp37Di@coredump.intra.peff.net \
    --to=peff@peff.net \
    --cc=alexander.d.mills@gmail.com \
    --cc=git@vger.kernel.org \
    /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.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).