Skip to content

Clone exactly what you need aka straightforward project scaffolding!

License

Notifications You must be signed in to change notification settings

nrjdalal/gitpick

Repository files navigation

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

GitPick Meme

✨ 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/TanStack/router     # repo without .git
npx gitpick TanStack/router/tree/main/examples     # a folder aka tree
npx gitpick TanStack/router/blob/main/README.md    # 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

📄 License

MIT – LICENSE