# M16 — repo rename + donor archive: PROCEDURE **Status**: documentation only — destructive GitHub operations must be done by the maintainer. This file describes the exact procedure. **When to run**: after M5 + M6 + M9 + M10 + M11 + M14 + M15 all land green, and before tagging `v1.0.0` (M17). ## Step 1 — rename donor repo first The donor (`GBeurier/nirs4all-methods`) currently owns the target slug. It must be renamed BEFORE the base repo can take that name. ```bash # Via gh CLI: gh repo rename --repo GBeurier/nirs4all-methods nirs4all-methods-archive # Or via web: Settings → General → Repository name ``` After renaming, the donor URL becomes: `https://github.com/GBeurier/nirs4all-methods-archive` GitHub auto-redirects the old URL to the new one for 6 months. Existing clones with the old URL keep working (with a redirect warning); fresh clones should use the new URL. ## Step 2 — archive the donor ```bash gh repo edit GBeurier/nirs4all-methods-archive --enable-issues=false \ --enable-projects=false --enable-wiki=false gh api -X PATCH /repos/GBeurier/nirs4all-methods-archive \ -f archived=true ``` Or via web: Settings → General → Danger Zone → Archive this repository. ## Step 3 — add the redirect NOTICE.md on the archive ```bash # Locally: git clone https://github.com/GBeurier/nirs4all-methods-archive.git cd nirs4all-methods-archive git checkout main cat > NOTICE.md < /tmp/donor-issues.json # For each issue, gh issue create on the unified repo with the original # title prefix '[archive #N]' to maintain ID continuity. ``` ## Step 7 — update CITATION.cff, badges, docs URLs ```bash cd /path/to/nirs4all-methods (renamed) # Edit CITATION.cff: url → https://github.com/GBeurier/nirs4all-methods # Edit README.md badges # Edit docs/_extras/*.json that hardcodes the repo URL ``` Then commit + push. ## Step 8 — verify on-ReadTheDocs / GitHub Pages ReadTheDocs and GitHub Pages may need re-linking: - ReadTheDocs: Admin → Edit → repository URL → update. - GitHub Pages: Settings → Pages — if the source is `main`, Pages auto-follows. If it's a separate branch like `gh-pages`, no change needed. ## Step 9 — final verification ```bash gh repo view GBeurier/nirs4all-methods --json url,defaultBranchRef,description,isArchived # expect: not archived, default main, url matches gh repo view GBeurier/nirs4all-methods-archive --json url,isArchived # expect: archived = true ``` ## Rollback (if something goes wrong) GitHub repo rename is reversible within the same UI: - Settings → General → Repository name → change back Old URL redirects remain active. No data is lost. For the archive flag: unarchive → re-archive. For the donor archive's NOTICE.md commit: standard `git revert`.