Subdirectories

Download specific folders from a repository.

Subdirectories

Download specific folders from a repository without fetching the entire repo. Useful for extracting components from monorepos or grabbing just the files you need.

Syntax

Append the subdirectory path after the repository name:

godegit user/repo/path/to/folder

Example

Download only the typescript template from the Vue templates repository:

godegit vuejs/create-vue-templates/typescript my-vue-app

This downloads just the typescript folder, not the entire repository.

Monorepo examples

# Download a specific package from a Next.js monorepo
godegit vercel/next.js/examples/blog-starter

# Download a single example from Nuxt
godegit nuxt/nuxt/examples/hello-world

# Download an Astro template
godegit withastro/astro/examples/minimal

Combining with flags

Subdirectory downloads work with all standard flags:

# Download from a specific branch
godegit user/repo/packages/my-package --branch develop

# Verbose output for debugging
godegit user/repo/src --verbose

Nested paths

You can download deeply nested directories:

# Three levels deep
godegit org/repo/packages/core/src/utils

Limitations

  • Glob patterns are not supported — specify exact paths
  • Multiple subdirectories require separate commands
  • Individual files cannot be downloaded — directories only

See also