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

Re: Why do git submodules require manual checkouts and commits?

From
LHLars Hjemli <lh@elementstorage.no>
Date
May 16, 2008, 14:58 UTC
Message-ID
<8c5c35580805160758n3b43c282i48009867b52106bf@mail.gmail.com>
In-Reply-To
<alpine.DEB.1.00.0805161521510.30431@racer>

On Fri, May 16, 2008 at 4:24 PM, Johannes Schindelin <Johannes.Schindelin@gmx.de> wrote:

Show 33 quoted lines
>  On Fri, 16 May 2008, Avery Pennarun wrote:
>
>
> > Think of it this way: I can commit, or not commit, my dirty Makefile at
>  > the same time as everything else (in a single project) with a single
>  > "git commit" line, depending on what I want to do.  Things like "git
>  > commit -a" and "git add -u" speed up the common case where I just want
>  > to commit everything.  But with submodules, that common case looks more
>  > like this:
>  >
>  >    cd sub
>  >    git checkout -b manual_branchname_because_there_was_no_default
>  >    git commit -a
>  >    git push etc.
>  >    cd ..
>  >    git commit -a
>  >    git push etc.
>
>  Funny, for me it looks completely different:
>
>  $ cd sub
>  # work, work, work
>  # from time to time commit
>  # from time to time rebase -i to clean up some things
>  # test, test, test
>  # sometimes push
>
>  And then, every once in a while, it is
>
>  $ cd ..
>  $ git add submodule
>  $ git commit -s submodule
>  $ git push
Just to add to the picture, for me it's

$ (cd submodule && git checkout tag) $ git add submodule $ git commit -s -m "Use submodule-tag"

If I want to work in/with the submodule, I usually do that by "cd ../submodule", i.e. I've got another clone of the submodule repository.

-- lh

Previous: Avery PennarunNext: skillzero@gmail.com
Message 8 of 9 in “Why do git submodules require manual checkouts and commits?”
  1. skillzero@gmail.comMay 16, 2008
  2. Johannes SchindelinMay 16, 2008
  3. Avery PennarunMay 16, 2008
  4. Johannes SchindelinMay 16, 2008
  5. Avery PennarunMay 16, 2008
  6. Johannes SchindelinMay 16, 2008
  7. Avery PennarunMay 16, 2008
  8. Lars HjemliMay 16, 2008
  9. skillzero@gmail.comMay 19, 2008

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.