Skip to main content

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.
1

Select Local Repository

When prompted, choose Yes to use a local repository:
2

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.
3

Configure Features

Select your desired features just like with remote repositories:
4

Set Output Options

Specify the output filename or folder name:

Key Differences

No Cloning Step

With local repositories, the tool skips the Git clone operation:
Notice there’s no “Repository cloned successfully” message.

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’s fs.existsSync():
If the path doesn’t exist, you’ll see an error:

Supported Path Formats

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.
This means you can convert:
  • Git repositories (.git directory 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.ignore file
See Configuration - Custom Exclusions for details.

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:
  1. Network latency for cloning
  2. Downloading repository data
  3. Temporary directory cleanup
For large repositories, this can save significant time.
Ensure you have read permissions for all files in the directory. Permission errors will cause the tool to fail during file processing.

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