Applying Overlays
This guide covers the different ways to apply overlays to a git repository.
Basic usage
Section titled “Basic usage”The simplest way to get started is to apply from a GitHub username. repoverlay fetches the available overlays and lets you pick interactively:
repoverlay apply tylerbutlerYou can also apply from a local directory or a full GitHub URL:
# Local directoryrepoverlay apply /path/to/overlay
# GitHub repositoryrepoverlay apply https://github.com/owner/repoWhere overlays come from
Section titled “Where overlays come from”repoverlay supports several source types. It determines the type automatically from what you pass to apply:
- Strings starting with
https://github.com/are treated as GitHub URLs - Strings that look like filesystem paths (
./,/,~/) are treated as local directories - Three-part strings like
org/repo/nameare treated as overlay repository references - Two-part strings like
owner/repoenter browse mode (interactive selection) - Single words like
tylerbutlerare treated as GitHub usernames
GitHub usernames
Section titled “GitHub usernames”repoverlay apply tylerbutlerThis fetches a default overlay repository for that user, shows available overlays filtered to your current repo, and lets you pick from an interactive list. The first time you use a source, repoverlay will ask if you want to save it for future use.
GitHub URLs
Section titled “GitHub URLs”# Default branchrepoverlay apply https://github.com/owner/repo
# Specific branch or tagrepoverlay apply https://github.com/owner/repo --ref developrepoverlay apply https://github.com/owner/repo/tree/v1.0.0
# Subdirectory within a reporepoverlay apply https://github.com/owner/repo/tree/main/overlays/rustGitHub sources are cached locally using shallow clones. Use repoverlay update to pull new changes later.
Overlay repository references
Section titled “Overlay repository references”If you've used a source before (or added one manually), you can reference a specific overlay by its path:
repoverlay apply org/repo/overlay-nameLocal directories
Section titled “Local directories”repoverlay apply /path/to/overlayrepoverlay apply ./relative/overlayFiles are symlinked directly from the source. Changes to the source are reflected immediately.
Managing sources
Section titled “Managing sources”When you apply from a username or owner/repo for the first time, repoverlay prompts you to save the source. You can also manage sources manually:
# Add a sourcerepoverlay source add tylerbutler
# List configured sourcesrepoverlay source list
# Remove a sourcerepoverlay source remove tylerbutlerSources are checked in priority order when resolving overlay references. Earlier sources have higher priority.
Conflict handling
Section titled “Conflict handling”If an overlay file conflicts with an existing file in the repo, repoverlay fails by default. You can control this behavior:
--force
Section titled “--force”Overwrite existing files:
repoverlay apply ./overlay --force--skip-conflicts
Section titled “--skip-conflicts”Skip conflicting files silently and continue with the rest:
repoverlay apply ./overlay --skip-conflicts--interactive
Section titled “--interactive”Prompt for each conflict individually:
repoverlay apply ./overlay --interactive--merge (JSON deep merge)
Section titled “--merge (JSON deep merge)”For JSON files, deep merge the overlay's content into the existing file instead of replacing it:
repoverlay apply ./overlay --mergeThis is useful when an overlay provides default settings that should be merged with a repository's existing configuration. For example, an overlay might add recommended VS Code extensions to an existing .vscode/settings.json.
Deep merge combines objects recursively — overlay keys are added or updated, but existing keys not in the overlay are preserved. For non-JSON files, --merge has no effect (the file is treated as a conflict).
Other options
Section titled “Other options”Copy mode
Section titled “Copy mode”Use --copy to copy files instead of creating symlinks:
repoverlay apply ./overlay --copyCustom overlay name
Section titled “Custom overlay name”repoverlay auto-generates a name from the source. Use --name to override it:
repoverlay apply ./overlay --name my-configTarget directory
Section titled “Target directory”By default, repoverlay applies to the current directory. Use --target to apply to a different repo:
repoverlay apply ./overlay --target /path/to/repoDry run
Section titled “Dry run”Preview what would happen without making changes:
repoverlay apply ./overlay --dry-run