Differences
This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision | ||
| git_submodules [2019/02/27 14:43] – [Committing the submodule] rpjday | git_submodules [2019/02/27 19:14] (current) – [Overview] rpjday | ||
|---|---|---|---|
| Line 2: | Line 2: | ||
| The good and the bad of submodules, using Wind River' | The good and the bad of submodules, using Wind River' | ||
| + | |||
| + | Stuff to add: | ||
| + | |||
| + | * '' | ||
| ===== Links ===== | ===== Links ===== | ||
| Line 384: | Line 388: | ||
| < | < | ||
| - | $ tree .git/ | + | $ ls -lF .git/ |
| - | .git/ | + | total 48 |
| - | ├── branches | + | drwxrwxr-x. 2 rpjday rpjday 4096 Feb 27 09:31 branches/ |
| - | ├── config | + | -rw-rw-r--. 1 rpjday rpjday |
| - | ├── description | + | -rw-rw-r--. 1 rpjday rpjday |
| - | ├── HEAD | + | -rw-rw-r--. 1 rpjday rpjday |
| - | ├── hooks | + | drwxrwxr-x. 2 rpjday rpjday 4096 Feb 27 09:31 hooks/ |
| - | │ ├── applypatch-msg.sample | + | -rw-rw-r--. 1 rpjday rpjday 7299 Feb 27 09:33 index |
| - | │ ├── commit-msg.sample | + | drwxrwxr-x. 2 rpjday rpjday 4096 Feb 27 09:31 info/ |
| - | │ ├── fsmonitor-watchman.sample | + | drwxrwxr-x. 3 rpjday rpjday 4096 Feb 27 09:31 logs/ |
| - | │ ├── post-update.sample | + | drwxrwxr-x. 4 rpjday rpjday 4096 Feb 27 09:31 objects/ |
| - | │ ├── pre-applypatch.sample | + | -rw-rw-r--. 1 rpjday rpjday 1161 Feb 27 09:31 packed-refs |
| - | │ ├── pre-commit.sample | + | drwxrwxr-x. 5 rpjday rpjday 4096 Feb 27 09:31 refs/ |
| - | │ ├── prepare-commit-msg.sample | + | |
| - | │ ├── pre-push.sample | + | |
| - | │ ├── pre-rebase.sample | + | |
| - | │ ├── pre-receive.sample | + | |
| - | │ └── update.sample | + | |
| - | ├── index | + | |
| - | ├── info | + | |
| - | │ └── exclude | + | |
| - | ├── | + | |
| - | │ ├── HEAD | + | |
| - | │ └── refs | + | |
| - | │ | + | |
| - | │ | + | |
| - | │ | + | |
| - | │ | + | |
| - | │ | + | |
| - | ├── | + | |
| - | │ ├── info | + | |
| - | │ └── pack | + | |
| - | │ | + | |
| - | │ | + | |
| - | ├── | + | |
| - | └── | + | |
| - | ├── heads | + | |
| - | │ └── develop | + | |
| - | ├── remotes | + | |
| - | │ └── origin | + | |
| - | │ | + | |
| - | └── tags | + | |
| - | + | ||
| - | 16 directories, | + | |
| $ | $ | ||
| </ | </ | ||
| Line 453: | Line 426: | ||
| $ | $ | ||
| </ | </ | ||
| + | |||
| + | Abbreviated form: | ||
| < | < | ||
| Line 484: | Line 459: | ||
| < | < | ||
| $ git push origin master | $ git push origin master | ||
| - | </ | ||
| - | |||
| - | ===== Under the hood ===== | ||
| - | |||
| - | The submodule directory has a //file// named '' | ||
| - | |||
| - | < | ||
| - | $ cat coroutine2/ | ||
| - | gitdir: ../ | ||
| - | $ | ||
| - | </ | ||
| - | |||
| - | From the superproject, | ||
| - | |||
| - | < | ||
| - | $ ls -l .git/ | ||
| - | total 48 | ||
| - | drwxrwxr-x. 2 rpjday rpjday 4096 Feb 13 15:37 branches | ||
| - | -rw-rw-r--. 1 rpjday rpjday | ||
| - | -rw-rw-r--. 1 rpjday rpjday | ||
| - | -rw-rw-r--. 1 rpjday rpjday | ||
| - | drwxrwxr-x. 2 rpjday rpjday 4096 Feb 13 15:37 hooks | ||
| - | -rw-rw-r--. 1 rpjday rpjday 7299 Feb 13 15:38 index | ||
| - | drwxrwxr-x. 2 rpjday rpjday 4096 Feb 13 15:37 info | ||
| - | drwxrwxr-x. 3 rpjday rpjday 4096 Feb 13 15:37 logs | ||
| - | drwxrwxr-x. 4 rpjday rpjday 4096 Feb 13 15:37 objects | ||
| - | -rw-rw-r--. 1 rpjday rpjday 1174 Feb 13 15:37 packed-refs | ||
| - | drwxrwxr-x. 5 rpjday rpjday 4096 Feb 13 15:37 refs | ||
| - | $ | ||
| - | </ | ||
| - | |||
| - | ===== Cloning a project with submodules ===== | ||
| - | |||
| - | If you don't want to populate the submodule directories: | ||
| - | |||
| - | < | ||
| - | $ git clone https:// | ||
| - | </ | ||
| - | |||
| - | If you want to populate the submodule diredctories: | ||
| - | |||
| - | < | ||
| - | $ git clone --recurse-submodules https:// | ||
| - | </ | ||
| - | |||
| - | Populate all submodules after the fact: | ||
| - | |||
| - | < | ||
| - | $ git submodule update --init --recursive | ||
| </ | </ | ||