Applying Overlays
Apply overlays to a git repository from a local directory, a GitHub URL, or a configured source.
Basic usage
Section titled “Basic usage”The simplest way to start is to browse overlays from a GitHub username. repoverlay fetches the available overlays and lets you pick interactively:
repoverlay browse tylerbutlerFor scripting or power-user workflows, point apply at a specific local directory, GitHub URL, or configured overlay reference:
# 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 browse or 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 configured source 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 browse 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.
A bare username expands to username/repo-overlays. To use a different repository name, set the REPOVERLAY_DEFAULT_REPO_NAME environment variable — for example, REPOVERLAY_DEFAULT_REPO_NAME=overlays expands tylerbutler to tylerbutler/overlays.
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.
Configured source references
Section titled “Configured source 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.
Local directory sources may use the shared org/repo/overlay-name/ layout or a flat
layout. In a flat layout, each top-level directory is an overlay; if there are no
top-level overlay directories, the source directory itself is treated as one overlay.
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. Merge targets must be repo-relative real files; repoverlay rejects target symlinks and symlinked parent directories instead of following them. For non-JSON files, --merge has no effect (the file is treated as a conflict).
To enable merging by default, set the REPOVERLAY_MERGE=true environment variable. It acts as the default for the --merge flag everywhere the flag exists (apply, switch, restore, and update).
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