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

git add after changing a submodule

From
PMPat Maddox <pergesu@gmail.com>
Date
Apr 4, 2008, 20:50 UTC
Message-ID
<810a540e0804041350u7fe4a5c4t7e86274e188e3e91@mail.gmail.com>

If I make a change to a submodule and commit it, I then have to add it to the parent repo. If I do

git add path/to/submodule
then it works fine.  But if I do
git add path/to/submodule/ (with trailing slash)
then it blows away the submodule and adds all the files in that directory.

Seems pretty dangerous to me. I know that I can just use git commit -a to do it, but I'd like to prevent the mistake of adding the path and screwing up the repo. Is it possible to protect the submodules a bit more?

Pat
Message 1 of 1 in “git add after changing a submodule”
  1. Pat MaddoxApr 4, 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.