The first of these is that if you had a typo in the name of a submodule listed on the command line, that would be silently ignored. Many actions that you might perform that relate to submodules are done with the git submodule command, but in older versions of git this has two problems that make it very easy to get confused – I think these are important enough that everyone who uses submodules should be aware of them, and ideally upgrade their copy of git to a version that doesn’t have these problems: at least version 1.6.2. … it’s worth checking what version of git you have. (More on that below.) If you change directory into the submodule then you’ll find that it doesn’t know anything about the the parent project at all, and you can carry out operations in that repository as if it were standalone. It’s important to understand that the repository which contains a submodule knows very little about it except for which version it should be and various bits of information about how to update it. (I’ll sometimes refer to the whatdotheyknow repository as the super-project, which I hope is clear.) In each project the commonlib repository has been added as a submodule. The example I’m going to use in this post however, called whatdotheyknow, is one of the various mySociety projects that depend on a repository called commonlib, which contains useful code common to at least one project. For example, if you’re developing a new Ruby-on-Rails application, you could add a clearly specified version of the Rails repository as a submodule at the path vendor/rails. This is a useful feature when you have a project in git which depends on a particular versions of other projects. What are submodules?Ī submodule in a git repository is like a sub-directory which is really a separate git repository in its own right. Submodules in git are commonly misunderstood in various ways, and although the explanation in the official manual is clear and pretty easy to understand, I thought that a different treatment here might be useful to someone. This is a public inbox, see mirroring instructionsįor how to clone and mirror all data and code used for this inbox Īs well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).I haven’t actually finished the FAQ bit of this post yet, but since I’m not sure when I’ll have time to do so, I’ll just publish it anyway – please let me know in the comments if this is useful for you, or there’s something else you’d like to see included. 12:24 Q: warning: unable to rmdir 'submodule': Directory not empty Ulrich WindlĬode repositories for project(s) associated with this public inbox links below jump to the message on this page. Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed) submodule directory contains untracked files Įnd of thread, other threads: > submodule directory was "mostly deleted", only leaving two object files that > When I tried "git checkout master -recurse-submodules" instead, the > expected to remove submodule directories manually before switching branches? > Well obviously the directory is not empty. > warning: unable to rmdir 'submodule': Directory not empty > checkout another branch that does not (yet) have that submodule, I get an > When a branch uses a submodule (named "submodule" here), and when you > I wonder whether you'd think this is a bug: > Ulrich Windl schrieb am um 13:24 in Nachricht : Sorry, I should have mentioned: git 2.26.2 on SLES12 SP5 12:24 Q: warning: unable to rmdir 'submodule': Directory not empty Ulrich 12:25 ` Ulrich Windl 0 siblings, 0 replies 2+ messages in thread * Antw: Q: warning: unable to rmdir 'submodule': Directory not empty submodule directory contains untracked files won't delete those." be better? 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. The point is: Is the user expected to remove submodule directories manually before switching branches? Well obviously the directory is not empty. Warning: unable to rmdir 'submodule': Directory not empty 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: I wonder whether you'd think this is a bug: Q: warning: unable to rmdir 'submodule': Directory not empty mailing list mirror (one of many) help / color / mirror / code / Atom feed * Q: warning: unable to rmdir 'submodule': Directory not empty 12:24 Ulrich WindlĠ siblings, 1 reply 2+ messages in thread
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |