| name | gitit |
| description | Clone a git repo and extract specific folders from it using PowerShell 7. Use this skill whenever the user wants to pull specific folders from a GitHub repository, extract parts of a repo, or copy subdirectories from a remote repo into their project. |
gitit
Clone a git repo and extract specific folders from it using PowerShell 7.
Usage
When the user invokes /gitit, run the gitit.ps1 script located in this skill's scripts/ directory. Construct the command from user input:
pwsh -Command "& '<skill-dir>/scripts/gitit.ps1'" -RepoUrl "<repo-url>" -Folders "<folder1>","<folder2>" -Destination "<target-path>"
Parameters
- RepoUrl (required) — The git repository URL to clone.
- Folders (required) — One or more folder paths within the repo to extract. Paths are relative to the repo root.
- Destination (optional) — Where to copy the extracted folders. Defaults to the current working directory.
Examples
Extract a single folder:
pwsh -Command "& 'gitit.ps1'" -RepoUrl "https://github.com/org/repo" -Folders "src/components"
Extract multiple folders to a specific location:
pwsh -Command "& 'gitit.ps1'" -RepoUrl "https://github.com/org/repo" -Folders "docs","scripts/deploy" -Destination "./vendor"
Behavior
- Clones the repo with
--depth 1 into a temp folder ($env:TEMP/<random-guid>).
- Copies each specified folder to the destination (using the folder's leaf name).
- Cleans up the temp clone automatically, even on failure.
- Warns and skips any folder path not found in the repo.