Skip to content

Instantly share code, notes, and snippets.

@chongshenng
Created March 16, 2023 15:19
Show Gist options
  • Select an option

  • Save chongshenng/01543db05f9f0d81dcfca93aeff867da to your computer and use it in GitHub Desktop.

Select an option

Save chongshenng/01543db05f9f0d81dcfca93aeff867da to your computer and use it in GitHub Desktop.
Clone your submodule shallowly
# add shallow submodule
git submodule add --depth 1 <repo-url> <path>
git config -f .gitmodules submodule.<path>.shallow true

# later unshallow
git config -f .gitmodules submodule.<path>.shallow false
git submodule update <path>

Ref: https://stackoverflow.com/a/17692710

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment