cloning into the folder you are already in, and what it destroys

`git clone <url> .` works only into a genuinely empty directory. verified: one
file makes it fail, and so does one HIDDEN file.

which is not an edge case on this machine — a commander's directory holds
CLAUDE.md and state/, and a plugin's chat directory holds a CLAUDE.md the
platform wrote. cloning into either fails outright.

the fetch-into-place workaround is written down because it is the answer, and
so is the thing it does quietly: `git checkout FETCH_HEAD -- .` OVERWRITES a
colliding file without asking. verified by doing it in a directory that had a
CLAUDE.md and watching it become the template's. in a commander directory that
is the brief gone, and the commander would come back next turn not knowing what
its job is.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Officer-Session: 656f5c85-e49a-4f1f-b9f3-042a04b4d043
This commit is contained in:
2026-08-25 20:13:28 +00:00
co-authored by Claude Opus 5
parent 8a1bcb03f5
commit b018aa52d2
@@ -19,6 +19,33 @@ shell; the SSH remote is already authenticated. If SSH is being refused for a st
behind a proxy that rate-limits it — `ssh://git@100.64.0.13:10023/templates/template-react.git` is the same
repository over the tailnet.
### Cloning into the folder you are already in
`git clone <url> .` works, **and only into a genuinely empty directory**. Verified: a single file makes it
fail, and so does a single HIDDEN one —
```
fatal: destination path '.' already exists and is not an empty directory.
```
That is not an edge case here. A commander's directory holds `CLAUDE.md` and `state/`; a plugin's chat
directory holds a `CLAUDE.md` the platform wrote. Cloning into either fails.
When the directory is not empty, fetch instead of cloning:
```bash
git init -q .
git remote add origin git@gitea.officer.dev:templates/template-react.git
git fetch -q --depth 1 origin HEAD
git checkout -q FETCH_HEAD -- .
git reset -q
```
**This overwrites a file that collides, without asking.** Also verified: doing it in a directory that
already had a `CLAUDE.md` replaced it with the template's. So look at what is there first, and if one of
those files is the platform's — a commander's brief, a plugin's chat brief — move it aside and put it back,
or clone somewhere else and copy in what you need.
## Then read its own documentation, and do step 1
The template documents itself. **`README.md` step 1 is a rename** — everything project-specific is called