# Re: \[PATCH\] User Manual: add a chapter for submodules

- From: Sven Verdoolaege \<hidden\>
- Date: 2016-06-15 22:43:35 
- List: git
- Page: https://ratatoskr.run/git/2016/06/7315786
- Thread: https://ratatoskr.run/git/2016/06/7315629/t.md

```text
On Wed, Sep 19, 2007 at 07:42:50PM +0200, Miklos Vajna wrote:
> +Submodules maintain their own identity; the submodule support just stores the
> +submodule repository location and commit ID, so other developers who clone the
> +superproject can easily clone all the submodules at the same revision.

[..]

> +-------------------------------------------------
> +$ mkdir super
> +$ cd super
> +$ git init
> +$ echo hi > super.txt
> +$ git add super.txt
> +$ git commit -m "Initial commit of empty superproject"
> +$ for i in a b c d
> +do
> +	git submodule add ~/git/$i
> +done
> +-------------------------------------------------

You may want to warn the reader not to use local URLs here if they
plan to publish their superproject.

> +It's not safe to run `git submodule update` if you've made changes within a
> +submodule. They will be silently overwritten:

This is only true if they didn't follow your advise of checking out
a branch first.

skimo
```
