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

Submodule confusion when checking out branch

From
Howard Miller <howard@e-learndesign.co.uk>
Date
Oct 11, 2011, 09:38 UTC
Message-ID
<CAHVO_90rHbqqUx6HCh7tLWO9aP9PyPMpYnZGszCDB2bfNzUXAQ@mail.gmail.com>
I added a submodule to my project like this (all from the root of the project)

git submodule add git@.....   path/to/submodule git submodule init git add path/to/submodule git commit -m 'I added a submodule!' git push

All looks good and 'git status' reports 'nothing to commit'
However, I now cannot change branches. On checkout, I get...

"error: The following untracked working tree files would be overwritten by checkout:" (followed by a big list of all the files in the submodule)

Where did I go wrong and what can I do to sort it?
Thanks again!
Next: Jens Lehmann
Message 1 of 2 in “Submodule confusion when checking out branch”
  1. Howard MillerOct 11, 2011
  2. Jens LehmannOct 11, 2011

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.