A fast, concurrent GitHub repository downloader that lets you download specific files, directories, or entire repositories without cloning the full git history.
demo.mp4
- 🚀 Fast concurrent downloads using Go goroutines
- 📁 Selective downloads - files, directories, or entire repos
- 🔐 GitHub token support for private repos and higher rate limits
- ⏱️ Smart timeouts and cancellation support
- 🌳 Branch/ref support - download from specific branches or commits
- 💾 Efficient - only downloads what you need, no git history
Using curl:
curl -fsSL https://raw.githubusercontent.com/rushikeshg25/partial-git/main/scripts/install.sh | bash
Using wget:
wget -qO- https://raw.githubusercontent.com/rushikeshg25/partial-git/main/scripts/install.sh | bash
- Download the latest binary for your platform from Releases
- Make it executable:
chmod +x pgit
- Move to your PATH:
sudo mv pgit /usr/local/bin/
- Linux (amd64, arm64)
- macOS (amd64, arm64)
- Windows (amd64)
# 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
For private repositories or higher rate limits:
# Set your GitHub Personal Access Token
pgit --set your_github_token_here
# Check token status
pgit --check
# View authenticated user info
pgit --auth
# Remove token
pgit --unset
# 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/vercel/next.js/blob/canary/packages/next/package.json
- GitHub API Integration: Uses GitHub's Contents API to fetch repository metadata
- Concurrent Downloads: Downloads multiple files simultaneously using goroutines
- Smart Path Handling: Automatically detects files vs directories and handles nested structures
- Rate Limiting: Respects GitHub's API rate limits with optional authentication
- Timeout Protection: 60-second timeout prevents hanging downloads
PGIT_GITHUB_TOKEN
- Your GitHub Personal Access Token (optional)
Tokens are stored in your shell profile (~/.zshrc
or ~/.bashrc
) for persistence across sessions.
git clone https://github.com/rushikeshg25/partial-git.git
cd partial-git
go build -o pgit .
go test ./...
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature
) - Commit your changes (
git commit -m 'Add some amazing feature'
) - Push to the branch (
git push origin feature/amazing-feature
) - Open a Pull Request