Skip to content

Private folder as standalone versioned git repo (replacing branch-based approach) #13

Description

@djdarcy

Summary

Replace the current 4-layer private content protection system (gitignore + .git/info/exclude + pre-commit hooks + content stripping) with a simpler architecture: private/ becomes a gitignored standalone nested git repo.

Problem

The current approach for protecting private content is complex and incomplete:

  1. Loss risk: private/ is gitignored -- content is never truly version-controlled unless you switch to the private branch and commit
  2. Worktree gap: github/ and dev/ worktrees can't access private/ (Auto-create symlinks/junctions to private/ in public worktrees #6, Auto-create private/ junctions in worktrees + browser extension template #10)
  3. Cognitive overhead: 4-layer protection system is hard to reason about
  4. No history: Design docs, postmortems, and analysis evolve but that evolution isn't tracked

Proposed Solution

Make private/ its own git repo, nested inside the project. The parent repo's .gitignore already excludes /private/, so the parent has zero awareness of the inner repo.

Why not submodules?

Approach Verdict
Formal submodule Rejected -- .gitmodules leaks info, branch-switching is hazardous, UX is poor
Gitignored nested repo Winner -- zero visibility to parent, full history, simplest mental model
Subtree Rejected -- embeds private content into parent history

Rollout

  1. Phase 1: dz private-init command in dazzlecmd -- one command initializes private/ as its own repo
  2. Phase 2: Integrate into repokit create / repokit adopt
  3. Phase 3: Create git-repokit-private-template, implement worktree junctions (Auto-create symlinks/junctions to private/ in public worktrees #6)

Impact on existing guardrails

Layer Current After
.gitignore Prevents staging Keep -- safety net
.git/info/exclude Branch-specific Simplify -- less needed
pre-commit hook Blocks private files Keep -- catches files outside private/
Content stripping Removes private on branch creation Simplify -- less content to strip

Migration for existing projects

cd project/local/private
git init
git add -A
git commit -m "init: migrate existing private content to standalone repo"

No parent repo changes needed -- private/ is already gitignored.

Related

Analysis

See 2026-04-02__21-57-43__private-folder-versioned-as-submodule-design.md for detailed analysis.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions