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

Q: warning: unable to rmdir 'submodule': Directory not empty

From
UWUlrich Windl <ulrich.windl@rz.uni-regensburg.de>
Date
Dec 29, 2021, 12:24 UTC
Message-ID
<61CC5390020000A10004692A@gwsmtp.uni-regensburg.de>
Hi!

I wonder whether you'd think this is a bug: When a branch uses a submodule (named "submodule" here), and when you checkout another branch that does not (yet) have that submodule, I get an error message saying: warning: unable to rmdir 'submodule': Directory not empty

Well obviously the directory is not empty. The point is: Is the user expected to remove submodule directories manually before switching branches?

When I tried "git checkout master --recurse-submodules" instead, the submodule directory was "mostly deleted", only leaving two object files that weren't ".gitignore"d. (But the error message was the same)

Wouldn't a message like "... submodule directory contains untracked files; won't delete those..." be better?

Regards, Ulrich

Next: Ulrich Windl
Message 1 of 2 in “Q: warning: unable to rmdir 'submodule': Directory not empty”
  1. Ulrich WindlDec 29, 2021
  2. Antw: Q: warning: unable to rmdir 'submodule': Directory not emptyUlrich Windl, Dec 29, 2021

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.