Created
August 15, 2017 09:11
-
-
Save nowox/4d7c055c3b892ab46e4cf76aac2653ec to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
~ $ cd test | |
~/test $ git init | |
git clone --depth=1 --no-checkout ../sub sub | |
git submodule add ../sub sub | |
git submodule absorbgitdirs | |
# note there is no "submodule.sub.sparsecheckout" key | |
git -C sub config core.sparseCheckout true | |
echo bar >>.git/modules/sub/info/sparse-checkout | |
git submodule update subInitialized empty Git repository in /cygdrive/c/Users/Ycr/Home/ppp/test/.git/ | |
~/test $ # I did not find a way to add submodule in 1 step without checking out | |
~/test $ git clone --depth=1 --no-checkout ../sub sub | |
Cloning into 'sub'... | |
warning: --depth is ignored in local clones; use file:// instead. | |
done. | |
~/test $ git submodule add ../sub sub | |
Adding existing repo at 'sub' to the index | |
~/test $ git submodule absorbgitdirs | |
Migrating git directory of 'sub' from | |
'/cygdrive/c/Users/Ycr/Home/ppp/test/sub/.git' to | |
'/cygdrive/c/Users/Ycr/Home/ppp/test/.git/modules/sub' | |
~/test $ # note there is no "submodule.sub.sparsecheckout" key | |
~/test $ git -C sub config core.sparseCheckout true | |
~/test $ echo bar >>.git/modules/sub/info/sparse-checkout | |
~/test $ git submodule update sub | |
~/test $ tree | |
. | |
└── sub | |
1 directory, 0 files |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment