Using Local Repositories
If you already have a repository on your local machine, you can skip the cloning step and process it directly. This is useful for:- Converting private repositories without authentication
- Processing repositories you’re actively developing
- Working offline or with limited network access
- Converting repositories from other Git hosting services
- Faster processing by avoiding the clone step
How It Works
When you select the local repository option, repo2pdf processes files directly from the directory you specify instead of cloning from GitHub.Provide Directory Path
Enter the full absolute path to your local repository:
The path must exist on your filesystem. The tool validates the directory exists before proceeding.
Key Differences
No Cloning Step
With local repositories, the tool skips the Git clone operation:No Repository Cleanup
Since the tool uses your existing directory, you won’t be prompted to keep or delete the repository. Your local files remain untouched.Path Validation
The tool validates that the path you provide exists using Node.js’sfs.existsSync():
Supported Path Formats
- Linux/macOS
- Windows
Use absolute paths starting from root:Or use the tilde for home directory:
Example Workflow
Here’s a complete example of converting a local repository:Working with Non-Git Directories
The directory doesn’t need to be a Git repository. Any directory structure works, as the tool processes files based on directory traversal, not Git metadata.
- Git repositories (
.gitdirectory is automatically excluded) - Plain directories with source code
- Extracted archives
- Project templates
File Exclusions Apply
The same exclusion rules apply to local repositories:- Universal excluded names (
.git,node_modules, etc.) - Universal excluded extensions (
.png,.jpg,.yml, etc.) - Custom exclusions via
repo2pdf.ignorefile
Use Cases
Private Development
Convert private repositories without setting up Git authentication
Non-GitHub Repos
Process repositories from GitLab, Bitbucket, or other services
Offline Work
Generate PDFs without internet connectivity
Active Development
Convert your current working directory with uncommitted changes
Performance Benefits
Using local repositories is faster because it skips:- Network latency for cloning
- Downloading repository data
- Temporary directory cleanup
Next Steps
Configuration
Explore all available features and options
Output Options
Learn about different PDF output modes
Basic Usage
Back to basic remote repository usage