git-dupe is a second Git repository for the files in a checkout that are yours and not
the project's: notes, plans, scratch scripts, editor settings, the instructions and
skills you keep for a coding agent. The files stay where their tools expect them in the
working tree. Their history lives in a repository of their own inside the project's
.git, hidden from the project's git status and git add -A, and moves between your
machines through a remote of your own. You already know how to drive it: public work is
git …, your own is git dupe …, with Git's own commands, options, output, and exit
codes.
On x86-64 or ARM64 Linux, or on macOS, with Git 2.43.0 or newer, below 3.0.0:
curl -fsSL https://raw.githubusercontent.com/BrianWeiHaoMa/git-dupe/main/install.sh | shIt puts the latest release's executable in ~/.local/bin and its manual page in
~/.local/share/man/man1, once the download matches its published digest.
On Windows 11 on x86-64, in PowerShell, with Git for Windows of the same versions:
irm https://raw.githubusercontent.com/BrianWeiHaoMa/git-dupe/main/install.ps1 | iexIt puts git-dupe.exe in ~\.local\bin, once the download matches its digest, and
prints the line that puts that directory on PATH, changing no setting of yours.
Installing has the rest: the archives by hand, from source, the Git
it needs, what Windows differs in, and uninstalling.
In a clone of a project, from the root, with notes/ a directory of yours and AGENTS.md
your instructions for a coding agent, neither of them the project's. <url> is a
repository of your own on a host or a disk you trust, created empty, with no README,
license, or ignore file; on a disk, git init --bare -b main makes one for a project on
main. A URL of the project's repository, or of any of its remotes, is refused.
git dupe init
git dupe add notes/ AGENTS.md
git dupe commit -m "Notes and agent instructions"
git dupe remote add origin <url>
git dupe push -u origin HEADOn another machine, in a clone of the project, the files come back; -b <branch> after
<url> names the project's branch where <url>'s default branch is another:
git dupe clone <url>From then on, git dupe pull and git dupe push move your work between machines. A file
the project's .gitignore ignores is added with -f, as git add adds one.
- It is Git. Every command but the few below is Git's own, with Git's options,
output, and exit status, run against the dupe; Git's global options go before
dupe. - Seven commands added:
initandcloneattach the dupe anddetachremoves it,hideandunhideedit the list of hidden paths,gitruns Git against the dupe with no guard, andhelpprints the texts. - Three commands changed:
statusandaddact on the hidden paths instead of every file of the project, andcleancleans the project while sparing them. - A few forms refused:
stash -uand-a, which would stash the whole project, and apush,pull,fetch,remote, orclonenaming the project's repository or any of its remotes.git dupe git <words>runs them when you mean it. - Plain
gitis not guarded. To the project's Git your files are ignored files:git clean -xdeletes them,git stash -astashes them,git add -fmakes them public, and a public pull or checkout that brings a file to one of their paths overwrites yours. Commit first:git dupe restore :/brings back every file the dupe tracks as last staged from any directory, over the project's file too where the project now tracks the path, which a publicgit addthen stages; there, read yours withgit dupe show HEAD:<path>instead, and restore the other paths by name.npm packand a Docker build never read.git/info/exclude, and take them unless their own ignore files leave them out (Limits). - Each worktree on its own. A linked worktree is attached by its own
git dupe initorgit dupe clone, andgit worktree removeandgit worktree prunedelete its dupe with it, whatever files of yours stand there. A push alone misses a file in no commit and a stash entry: Questions has the order to follow first. - Nothing is encrypted. Push to a remote you would trust with the files.
More of what it does not do is under Limits, and
git dupe detach takes it back out, leaving every file on disk.
- How it works: the dupe, the hidden paths, what git-dupe writes, its limits, and the specification it is built to.
- What it is for: the uses it was made for, and how it compares with what you may already use.
- Questions: worktrees, teams, clones, and getting out.
- Installing: the scripts, the archives by hand, from source, and the Git it needs.
git dupe help, andgit dupe help <command>for each command git-dupe adds or changes: a screen each, from the executable alone.man git-dupe, where the manual page is installed, which is not on Windows: the commands, a quick start, examples, and explanations.PRODUCT_SPECIFICATION.md: what git-dupe does and guarantees, and what it does not;TECHNICAL_SPECIFICATION.md: how each guarantee holds.CONTRIBUTING.md: what governs a change, how to report a problem, and how to run the checks;CHANGELOG.md: what changed in each release;RELEASING.md: what a release holds and how one is made.
MIT, in LICENSE.
