๐Ÿ“ฆ nrjdalal / gitpick

Clone exactly what you need aka straightforward project scaffolding!

โ˜… 250 stars โ‘‚ 4 forks ๐Ÿ‘ 250 watching โš–๏ธ MIT License
clonedegitdirectoryfilefoldergitgithubrepositoryscaffoldingtemplateurl
๐Ÿ“ฅ Clone https://github.com/nrjdalal/gitpick.git
HTTPS git clone https://github.com/nrjdalal/gitpick.git
SSH git clone git@github.com:nrjdalal/gitpick.git
CLI gh repo clone nrjdalal/gitpick
Neeraj Dalal Neeraj Dalal chore: tweaks > test.sh 3e031e8 2 months ago ๐Ÿ“ History
๐Ÿ“‚ main View all commits โ†’
๐Ÿ“ .github
๐Ÿ“ bin
๐Ÿ“ scripts
๐Ÿ“ types
๐Ÿ“„ .gitignore
๐Ÿ“„ bun.lock
๐Ÿ“„ CHANGELOG.md
๐Ÿ“„ LICENSE
๐Ÿ“„ package.json
๐Ÿ“„ README.md
๐Ÿ“„ tsconfig.json
๐Ÿ“„ tsdown.config.ts
๐Ÿ“„ README.md

GitPick

Clone exactly what you need aka straightforward project scaffolding!

๐Ÿ“ฆ Zero dependencies / Un/packed (<35/15kb) / Faster and more features yet drop-in replacement for degit

Twitter npm downloads stars

#### Just copy-and-paste any GitHub URL - no editing required (shorthands work too) - to clone individual files, folders, branches, commits, raw content or even entire repositories without the .git directory.

Unlike other tools that force you to tweak URLs or follow strict formats to clone files, folders, branches or commits GitPick works seamlessly with any URL.

GitPick Meme


๐Ÿ“– Some Examples

See Quick Usage for to learn more.

# clone a repo without .git
npx gitpick owner/repo
npx gitpick https://github.com/owner/repo
# clone a folder aka tree
npx gitpick owner/repo/tree/main/path/to/folder
npx gitpick https://github.com/owner/repo/tree/main/path/to/folder
# clone a file aka blob
npx gitpick owner/repo/blob/main/path/to/file
npx gitpick https://github.com/owner/repo/blob/main/path/to/file
# clone a branch
npx gitpick owner/repo -b canary
npx gitpick https://github.com/owner/repo -b canary
npx gitpick owner/repo/tree/canary
npx gitpick https://github.com/owner/repo/tree/canary
# clone a commit SHA
npx gitpick owner/repo -b cc8e93
npx gitpick https://github.com/owner/repo/commit/cc8e93
# clone submodules
npx gitpick owner/repo -r
npx gitpick https://github.com/owner/repo -r
# clone a private repo
npx gitpick https://<token>@github.com/owner/repo


โœจ Features

  • ๐Ÿ” Clone individual files or folders from any GitHub repository
  • โš™๏ธ Auto-detects branches and target directory (if not specified) like git clone
  • ๐Ÿง  Use shorthands TanStack/router or full URL's https://github.com/TanStack/router
  • ๐Ÿ—‘๏ธ Overwrite or replace existing files without a prompt using -o | --overwrite
  • ๐Ÿ“ฆ Can easily clone all submodules with -r | --recursive
  • ๐Ÿ” Sync changes remotely with --watch using intervals (e.g., 15s, 1m, 1h)
  • ๐Ÿ” Seamlessly works with both public and private repositories using a PAT

๐Ÿš€ Quick Usage

npx gitpick <url/shorthand> [target] [options]

  • [target] and [options] are optional, if not specified, GitPick fallbacks to the default behavior of git clone
Examples:

npx gitpick https://github.com/owner/repo          # repo without .git
npx gitpick owner/repo/tree/main/path/to/folder    # a folder aka tree
npx gitpick owner/repo/blob/main/path/to/file      # a file aka blob

npx gitpick <url/shorthand>                        # default git behavior
npx gitpick <url/shorthand> [target]               # with optional target
npx gitpick <url/shorthand> -b [branch/SHA]        # branch or commit SHA
npx gitpick <url/shorthand> -o                     # overwrite if exists
npx gitpick <url/shorthand> -r                     # clone submodules
npx gitpick <url/shorthand> -w 30s                 # sync every 30 seconds
npx gitpick https://<token>@github.com/owner/repo  # private repository

Image


๐Ÿ”ง Options

-b, --branch       Branch/SHA to clone
-o, --overwrite    Skip overwrite prompt
-r, --recursive    Clone submodules
-w, --watch [time] Watch the repository and sync every [time]
                   (e.g. 1h, 30m, 15s)
-h, --help         display help for command
-v, --version      display the version number


๐Ÿ” Private Repos

Use a GitHub personal access token (create one ๐Ÿ‘‰ here) with repo -> contents: read-only permission:

npx gitpick https://<token>@github.com/owner/repo


๐Ÿ“ฆ Install Globally (Optional)

npm install -g gitpick
gitpick <url/shorthand> [target] [options]


๐Ÿ›  More Tools

Check out more projects at github.com/nrjdalal

๐Ÿ”— Related Projects

  • tiged - community driven fork of degit
  • giget - alternative approach
Star History Chart

๐Ÿค Contributing

Contributions welcome โ€” any help is appreciated!

  • Fork the repo and create a branch (use descriptive names, e.g. feat/ or fix/).
  • Make your changes, add tests if applicable, and run the checks:
  • bun install
  • bun run sync:external
  • bun test
  • Follow the existing code style and commit message conventions (use conventional commits: feat, fix, docs, chore).
  • Open a PR describing the change, motivation, and any migration notes; link related issues.
  • For breaking changes or large features, open an issue first to discuss the approach.
  • By contributing you agree to the MIT license and the project's Code of Conduct.
Thank you for helping improve GitPick!

๐Ÿ“„ License

MIT โ€“ LICENSE