migrate: compliance-gated re-clone + per-machine state recovery script
Adds .claude/scripts/migrate-to-submodules.sh — self-contained, distributable by raw URL since old clones can't pull. Detects compliance (history merge-base vs origin, RECLONE.md+submodule offline fallback); leaves compliant clones untouched; otherwise re-clones AND recovers the gitignored per-machine state a clone never carries (identity.json, settings.local.json, .mcp.json, grepai, per-project .env/.venv/.attachments), surfaces stranded unpushed commits, and FLAGS large purged data for manual move (never re-imports it into git). Closes RECLONE.md's "recover any uncommitted work" gap that stranded identity.json + the discord-bot venv. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
16
RECLONE.md
16
RECLONE.md
@@ -4,13 +4,25 @@ History was rewritten: every project split into its own Gitea repo (now git **su
|
||||
and large data/history purged. `.git` went 3.2 GB → ~80 MB. An OLD clone (multi-GB `.git`,
|
||||
no submodules) is **incompatible** — do NOT `/sync`, `/save`, or `git push` from it.
|
||||
|
||||
Re-clone:
|
||||
Automated (preferred) — compliance-gated; leaves a compliant clone untouched, otherwise
|
||||
re-clones AND recovers the gitignored per-machine state a clone never carries (identity.json,
|
||||
settings.local.json, .mcp.json, grepai, per-project .env/.venv/.attachments) and flags large
|
||||
purged data for manual preservation:
|
||||
```
|
||||
bash .claude/scripts/migrate-to-submodules.sh --check # report compliance only (read-only)
|
||||
bash .claude/scripts/migrate-to-submodules.sh # dry-run the plan
|
||||
bash .claude/scripts/migrate-to-submodules.sh --confirm # execute
|
||||
```
|
||||
An OLD clone can't pull this script — grab it by raw URL:
|
||||
`https://git.azcomputerguru.com/azcomputerguru/claudetools/raw/branch/main/.claude/scripts/migrate-to-submodules.sh`
|
||||
|
||||
Manual equivalent:
|
||||
```
|
||||
cd <parent>; mv ClaudeTools ClaudeTools.old
|
||||
git clone https://git.azcomputerguru.com/azcomputerguru/claudetools.git ClaudeTools
|
||||
cp ClaudeTools.old/.claude/identity.json ClaudeTools/.claude/ # gitignored, per-machine — keep it
|
||||
cd ClaudeTools && git submodule update --init --recursive
|
||||
# recover any uncommitted work from ClaudeTools.old, then delete it
|
||||
# recover gitignored per-machine state (.env/.venv/.attachments/settings.local.json/.mcp.json) from .old, then delete it
|
||||
```
|
||||
Project history now lives in the submodules under `projects/`. Full pre-split backup bundle:
|
||||
`\172.16.3.20\Backups\Gitea-Storage\claudetools-pre-split-2026-06-18.bundle`
|
||||
|
||||
Reference in New Issue
Block a user