regraft lets you copy code from any git repo, rewrite it to fit your project, and still pull upstream updates later.
$ curl -fsSL https://useregraft.com/install.sh | bashadd → edit → note → pull → resolve. That's it.
┌──────────────────┐ regraft add ┌─────────────────────┐
│ upstream repo │───────────────────▶│ your repo │
│ (any git host) │ │ lib/components/ │
└────────┬─────────┘ │ regraft.json ✓ │
│ │ PATCH.md ✓ │
│ new commits └──────────┬──────────┘
▼ │ edit + note
┌──────────────────┐ regraft pull │
│ three-way merge │◀──────────────────────────────┘
│ (diff3) │
└────────┬─────────┘
│
┌────┴─────────────────┐
▼ ▼
no overlap conflict
merges on its own markers + brief ──▶ regraft resolveregraft add copies the files in and records where they came from in regraft.jsonregraft note. One sentence, saved in PATCH.mdregraft pull brings in upstream updates. Changes that don't touch your edits merge on their ownregraft resolveregraft.json records exactly which commit each copy came from and what every file looked like. So regraft always knows whether you changed a file, upstream did, or both.
After editing, write one sentence with regraft note. Notes collect in PATCH.md, so when a conflict shows up later, it arrives with your reasons, not just a diff.
Updates merge into your edited copy the same way git merges branches. regraft knows the version your edits started from, so it can tell your changes and upstream's apart.
When a merge needs a human call, regraft doesn't guess. It stops and writes a short brief: what clashed, why you changed it, and what upstream did. You or your agent decides.
regraft fetches with your own git and your existing credentials. If git clone works (GitHub, GitLab, self-hosted, private), regraft works. No tokens, no rate limits.
regraft status exits 1 when something needs attention, and every command can output JSON. Easy to script, easy for agents to read.
Whole repos, directories, single files, branches, tags, even an open PR, so pull keeps following it as the author pushes.
Fetching uses your own git and your existing credentials (GitHub, GitLab, self-hosted, private). No tokens, no rate limits.
A few habits that pay off once copied code is part of your codebase.
regraft does the mechanical work: fetching, tracking, merging. When a merge needs judgment, it stops and writes a brief instead of guessing, and whoever picks it up, you or a coding agent, makes the call.
If an agent works in your repo, point it at skills/regraft/SKILL.md.
Copying, merging, and where regraft draws the line.
Free and open source. Install it and track your first copy in under a minute.