Skip to content

A lightweight CLI to fetch individual files from remote Git repositories and track them locally for reproducibility.

License

Notifications You must be signed in to change notification settings

arkahna/git-file-fetch

git-file-fetch

CI npm version license: MIT node >= 20

A lightweight CLI to fetch individual files from remote Git repositories and track them locally for reproducibility.

Quick Start

🚀 Just want to use it?

npx @arkahna/git-file-fetch "https://github.com/user/repo.git@main:path/to/file.ts"

📦 Want to install it?

npm install -D @arkahna/git-file-fetch
npx @arkahna/git-file-fetch "https://github.com/user/repo.git@main:path/to/file.ts"

🔧 Want to test/develop it?

git clone https://github.com/arkahna/git-file-fetch.git
cd git-file-fetch
pnpm install
pnpm build
node dist/index.js "https://github.com/octokit/core.js.git@main:LICENSE" --dry-run

Available development commands:

  • pnpm build - Build the project
  • pnpm typecheck - Run TypeScript type checking
  • pnpm lint:check - Run ESLint checks
  • pnpm lint - Run ESLint with auto-fix
  • pnpm test:smoke - Run smoke test

What it does

  • Shallow Fetch: Performs a shallow fetch of the target ref without a full clone
  • File Extraction: Reads the file at that specific commit using git show
  • Local Copy: Copies the requested file(s) into your current working directory
  • Manifest Update: Writes an entry for each fetched file to a manifest for tracking provenance

Documentation

Requirements

  • Git available on your PATH
  • Node.js >= 20 (supports 20, 22, 23, 24)

License

MIT © Arkahna

About

A lightweight CLI to fetch individual files from remote Git repositories and track them locally for reproducibility.

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published