Skip to main content
NewSelective File/Folder Download

pgit — partial-git

A fast, concurrent GitHub repository downloader for files, directories, or entire repos without cloning full git history.

bash
curl -fsSL https://raw.githubusercontent.com/rushikeshg25/partial-git/main/scripts/install.sh | bash

Try a quick directory download after installation

Loading video...

See pgit in action

Quick overview

Why pgit?

A fast, concurrent GitHub repository downloader that fetches only what you need files, directories, or full repos without cloning history.

Fast concurrent downloads
Parallelized with Go goroutines for maximum throughput.
Selective download
Fetch files, directories, or entire repositories.
GitHub token support
Access private repos and lift API limits securely.
Smart timeouts
60-second timeout and cancellation to prevent hangs.
Branch/ref support
Download from specific branches or commits.
Efficient by design
Only downloads what you need—no git history.

Installation

Quick install is recommended. Copy one of the commands below.

Using curl
bash
curl -fsSL https://raw.githubusercontent.com/rushikeshg25/partial-git/main/scripts/install.sh | bash
Using wget
bash
wget -qO- https://raw.githubusercontent.com/rushikeshg25/partial-git/main/scripts/install.sh | bash

Basic Usage

Download entire repos, directories, files, or from specific branches.

bash
# Download entire repository
pgit https://github.com/user/repo

# Download specific directory
pgit https://github.com/user/repo/tree/main/src

# Download specific file
pgit https://github.com/user/repo/blob/main/README.md

# Download from specific branch
pgit https://github.com/user/repo/tree/develop

Examples

Some quick links to get you started.

bash
# Download VS Code's common utilities
pgit https://github.com/microsoft/vscode/tree/main/src/vs/base/common

# Download React's source code
pgit https://github.com/facebook/react/tree/main/packages/react/src

# Download a specific config file
pgit https://github.com/facebook/react/blob/main/package.json

How It Works

Under the hood, pgit is optimized for speed and reliability.

  • GitHub API Integration

    Uses GitHub Contents API to fetch repository metadata and resolve paths.

  • Concurrent Downloads

    Downloads multiple files simultaneously with Go goroutines for maximum throughput.

  • Smart Path Handling

    Automatically detects files vs directories and handles nested structures gracefully.

  • Rate Limiting + Timeouts

    Respects GitHub rate limits and uses a 60s timeout to avoid hanging downloads.

  • Branch/Ref Support

    Download from specific branches or commits with precise ref resolution.

Ready to fetch only what you need?

Install pgit and start downloading files and folders without cloning full history.