Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/gas-buddy/git-shallow
Download subdirectories from a git repo with as little network and disk overhead as possible
https://github.com/gas-buddy/git-shallow
Last synced: about 2 months ago
JSON representation
Download subdirectories from a git repo with as little network and disk overhead as possible
- Host: GitHub
- URL: https://github.com/gas-buddy/git-shallow
- Owner: gas-buddy
- Created: 2020-05-13T01:53:13.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2020-05-24T03:45:41.000Z (over 4 years ago)
- Last Synced: 2024-11-07T21:12:03.473Z (2 months ago)
- Language: JavaScript
- Size: 143 KB
- Stars: 0
- Watchers: 5
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
Awesome Lists containing this project
README
git-shallow
===========A package to download subdirectories from a (potentially) large repo with as little network
and disk overhead as possible. Uses git via child_process to shallow clone. Requires git
version 2.26.0 or higher. Currently only supports synchronous usage.Usage
=====As a module:
```
npm i git-shallow
``````
import gitShallow from 'git-shallow';gitShallow({
repository: '[email protected]:gas-buddy/git-shallow.git', // Your repo URL here
branch: 'master', // Whatever branch you want
repositoryPath: '.github/workflows', // The path inside the repo to download
workingDirectory: 'my-local-dir', // The local directory where the files will be based
})
```With npx:
```
npx git-shallow [email protected]:gas-buddy/git-shallow.git#master .github/workflows my-local-dir
```In both cases, the files will be in my-local-dir/.github/workflows, and my-local-dir/.git will exist as
well, and will make future runs faster (so try not to blow it away all the time if you don't have to).