Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ayan4m1/git-clone-sparse
Perform a sparse clone of a Git repository.
https://github.com/ayan4m1/git-clone-sparse
git nodejs sparse-checkout typescript utility
Last synced: 11 days ago
JSON representation
Perform a sparse clone of a Git repository.
- Host: GitHub
- URL: https://github.com/ayan4m1/git-clone-sparse
- Owner: ayan4m1
- License: mit
- Created: 2024-03-03T08:10:12.000Z (8 months ago)
- Default Branch: main
- Last Pushed: 2024-10-18T16:18:44.000Z (20 days ago)
- Last Synced: 2024-10-18T18:37:43.922Z (20 days ago)
- Topics: git, nodejs, sparse-checkout, typescript, utility
- Language: TypeScript
- Homepage:
- Size: 346 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# git-clone-sparse
[![npm version](https://badge.fury.io/js/@ayan4m1%2Fgit-clone-sparse.svg)](https://badge.fury.io/js/@ayan4m1%2Fgit-clone-sparse)
## features
- Written in TypeScript
- Small footprint
- Saves time when cloning large repos## requirements
- Node 18+
## installation
> npm i -g @ayan4m1/git-clone-sparse
## usage
> git-clone-sparse ./local-dir https://github.com/user/repo ./path1/ ./path2/
OR
> git-clone-sparse -g ./local-dir https://github.com/user/repo "\*\*/\*.safetensors"
Each command creates a directory called `local-dir` in your current working directory and then clones the specified URL. If you use **glob mode**, pass the `-g` flag. If you want to use a list of directories instead, do not use the `-g` flag.
## api
```ts
import cloneSparse from '@ayan4m1/git-clone-sparse';...
await cloneSparse(
'./new-repo-dir', // working copy directory
'https://github.com/ayan4m1/git-clone-sparse' // repo URL
['./README.md'] // paths to include,
{
globs: false,
force: false
} // optional options object
);
```