Grand Diomande Research · Full HTML Reader

Git Synchronization Strategy

``` Main Repo (points to cc-studio.git) ❌ MISMATCHED │ ├── apps/ios/cc-handguard/.git # Separate repo ├── apps/web/cc-dashboard/.git # Separate repo (has remote) ├── apps/web/cc-studio/.git # Separate repo │ ├── core/cc-core/.git # Separate repo ├── core/cc-trajectory/.git # Separate repo (large, 4GB) │ └── [6 more nested repos inside trajectory] # Deep nesting │ └── backend/cc-mcs/.git # Likely exists ```

Embodied Trajectory Systems proposal backlog reference score 26 .md

Full Public Reader

Git Synchronization Strategy

Date: 2025-12-17
Status: Action Required

---

Current Situation Analysis

### Main Repository
- Current remote: `https://github.com/Diomandeee/cc-studio.git`
- Issue: Points to cc-studio but contains entire Computational Choreography project
- Recent commits: Show submodule updates for cc-dashboard

Nested Git Repositories Found

11 nested repositories within your main repo:

Main Repo (points to cc-studio.git) ❌ MISMATCHED
│
├── apps/ios/cc-handguard/.git                    # Separate repo
├── apps/web/cc-dashboard/.git                    # Separate repo (has remote)
├── apps/web/cc-studio/.git                       # Separate repo
│
├── core/cc-core/.git                             # Separate repo
├── core/cc-trajectory/.git                       # Separate repo (large, 4GB)
│   └── [6 more nested repos inside trajectory]   # Deep nesting
│
└── backend/cc-mcs/.git                           # Likely exists

The Problem

Git is confused because:
1. Your main repo remote is `cc-studio.git` (just one component)
2. But the repo contains the entire 17GB Computational Choreography project
3. You have nested repos that are not configured as submodules
4. Git sees these nested repos as "deleted files" (the `D` in git status)

---

Recommended Strategy: Git Submodules ✅

Yes, it's a good idea to keep everything in one repository using Git Submodules.

Why Submodules?

Benefits:
- ✅ Work on entire project in one place
- ✅ Each component has its own repo (independent versioning)
- ✅ Main repo tracks specific commits of each submodule
- ✅ Easy to update individual components
- ✅ Can open in one IDE/workspace

Challenges:
- ⚠️ Requires explicit submodule commands (`git submodule update`)
- ⚠️ Collaborators need to know about submodules
- ⚠️ Slightly more complex workflow

Alternative: Monorepo (Not Recommended for You)

  • All code in one repo, no nesting
  • Would require merging all separate repo histories
  • Lose independent component versioning
  • Not suitable when you already have separate repos

---

Step-by-Step Migration Plan

Phase 1: Create New Main Repository ✅ RECOMMENDED

Create a new main repo that properly represents the full project:

1. Create GitHub repo: `computational-choreography` (or `cc-main`)
2. Convert existing nested repos to submodules
3. Push everything with proper structure

Phase 2: Configure Submodules

This will formalize your existing nested repos as proper submodules.

---

Implementation: Detailed Steps

Step 1: Create New Main Repository on GitHub

bash
# Go to GitHub and create a new repository:
# Name: "computational-choreography" (or "cc-main")
# Description: "Computational Choreography - Motion Control Platform"
# Private/Public: Your choice
# DO NOT initialize with README (we'll push existing)

Step 2: Update Main Repo Remote

bash
cd "[home]/Desktop/Computational Choreography"

# Add new remote (keep old one as backup)
git remote add cc-main https://github.com/Diomandeee/computational-choreography.git

# Or rename existing remote
git remote rename origin cc-studio-old
git remote add origin https://github.com/Diomandeee/computational-choreography.git

Step 3: Remove Nested Repos (Temporarily)

We need to remove the nested `.git` directories and add them as proper submodules:

bash
cd "[home]/Desktop/Computational Choreography"

# IMPORTANT: First, note down the GitHub URLs for each nested repo
# You'll need these for submodule configuration

# Remove nested .git directories (we'll re-add as submodules)
# BACKUP FIRST! (you should already have the backup from reorganization)

# For each nested repo, note its current remote:
cd apps/ios/cc-handguard && git remote -v && cd ../../..
cd apps/web/cc-dashboard && git remote -v && cd ../../..
cd apps/web/cc-studio && git remote -v && cd ../../..
cd core/cc-core && git remote -v && cd ../../..
cd core/cc-trajectory && git remote -v && cd ../../..

Step 4: Check Nested Repo Remotes

First, let's see what GitHub repos exist for each component:

bash
# Check if each nested repo has a GitHub remote
cd "[home]/Desktop/Computational Choreography"

echo "=== cc-handguard ==="
cd apps/ios/cc-handguard && git remote -v || echo "No remote"
cd ../../..

echo "=== cc-dashboard ==="
cd apps/web/cc-dashboard && git remote -v || echo "No remote"
cd ../../..

echo "=== cc-studio ==="
cd apps/web/cc-studio && git remote -v || echo "No remote"
cd ../../..

echo "=== cc-core ==="
cd core/cc-core && git remote -v || echo "No remote"
cd ../../..

echo "=== cc-trajectory ==="
cd core/cc-trajectory && git remote -v || echo "No remote"
cd ../../..

Step 5: Push Each Nested Repo (If Not Already)

For each nested repo without a GitHub remote, create one:

bash
# Example for cc-core (repeat for each)
cd core/cc-core

# Create GitHub repo first: https://github.com/Diomandeee/cc-core
git remote add origin https://github.com/Diomandeee/cc-core.git

# Push
git add .
git commit -m "Initial commit from reorganization"
git push -u origin main

cd ../..

Step 6: Convert to Submodules

Once all nested repos are pushed to GitHub:

bash
cd "[home]/Desktop/Computational Choreography"

# Remove nested .git directories (keep the code)
# We'll re-add them as submodules, which recreates .git properly

# Remove just the .git directory, keep all code
rm -rf apps/ios/cc-handguard/.git
rm -rf apps/web/cc-dashboard/.git
rm -rf apps/web/cc-studio/.git
rm -rf core/cc-core/.git
rm -rf core/cc-trajectory/.git

# Now add as proper submodules
git submodule add https://github.com/Diomandeee/cc-handguard.git apps/ios/cc-handguard
git submodule add https://github.com/Diomandeee/cc-dashboard.git apps/web/cc-dashboard
git submodule add https://github.com/Diomandeee/cc-studio.git apps/web/cc-studio
git submodule add https://github.com/Diomandeee/cc-core.git core/cc-core
git submodule add https://github.com/Diomandeee/cc-trajectory.git core/cc-trajectory

# This creates .gitmodules file with proper submodule configuration

Step 7: Commit and Push Main Repo

bash
cd "[home]/Desktop/Computational Choreography"

# Add everything (submodules are now tracked properly)
git add .
git add .gitmodules

# Commit
git commit -m "feat: Reorganize project with proper submodule structure

- Reorganized into apps/, backend/, core/, models/, tools/
- Configured nested repos as Git submodules
- Platform separation: ios/, desktop/, web/
- 25 organized directories at root (down from 60+ loose files)

Submodules:
- apps/ios/cc-handguard
- apps/web/cc-dashboard
- apps/web/cc-studio
- core/cc-core
- core/cc-trajectory"

# Push to new main repo
git push -u origin main

---

Daily Workflow with Submodules

Cloning the Project (Fresh Start)

bash
# Clone main repo with all submodules
git clone --recursive https://github.com/Diomandeee/computational-choreography.git

# Or if already cloned without --recursive:
git clone https://github.com/Diomandeee/computational-choreography.git
cd computational-choreography
git submodule update --init --recursive

Working on a Submodule

bash
# Navigate to submodule
cd core/cc-core

# Make changes
# ... edit files ...

# Commit in submodule
git add .
git commit -m "feat: add new gesture detector"
git push

# Go back to main repo
cd ../..

# Main repo now shows cc-core has new commits
git status  # Shows: modified: core/cc-core (new commits)

# Update main repo to track new submodule commit
git add core/cc-core
git commit -m "chore: Update cc-core submodule"
git push

Updating All Submodules

bash
# Pull latest changes for all submodules
cd "[home]/Desktop/Computational Choreography"

git submodule update --remote --merge

# Or update specific submodule
git submodule update --remote --merge core/cc-core

Checking Submodule Status

bash
# See which submodules have uncommitted changes
git submodule foreach 'git status'

# See which submodules have unpushed commits
git submodule foreach 'git log origin/main..HEAD --oneline'

---

Alternative: Simpler Approach (Quick Fix)

If you want to push everything now without converting to submodules:

Quick Option: Remove Nested .git, Push as Monorepo

Warning: This loses the separate repo history for nested repos.

bash
cd "[home]/Desktop/Computational Choreography"

# Remove ALL nested .git directories (make backup first!)
find . -mindepth 2 -name ".git" -type d -exec rm -rf {} +

# Now everything is one big repo
git add .
git commit -m "refactor: Reorganize project structure (monorepo)"

# Create new GitHub repo and push
git remote add origin https://github.com/Diomandeee/computational-choreography.git
git push -u origin main

Pros:
- Simple, single repo
- Easy to push everything at once
- No submodule complexity

Cons:
- Lose separate repo histories
- Can't version components independently
- Harder to share individual components

---

Recommended Path Forward

For Your Situation: Git Submodules ✅

Why: You already have separate GitHub repos for components (cc-dashboard shows submodule commits), so formalize this structure.

Steps:
1. ✅ Check which nested repos already have GitHub remotes
2. ✅ Push any nested repos without remotes to GitHub
3. ✅ Remove nested .git directories
4. ✅ Re-add as proper submodules with `git submodule add`
5. ✅ Create new main repo: `computational-choreography`
6. ✅ Push everything with submodule configuration

Time: ~30-45 minutes
Complexity: Medium (but worth it for proper structure)

---

Decision Matrix

ApproachProsConsRecommended?
Git SubmodulesIndependent versioning, proper structure, maintains historySlightly complex workflowYES - You already use this pattern
Monorepo (remove nested .git)Simple, one repo, easy pushLose component histories, no independent versioning⚠️ Only if you don't care about component histories
Keep Current SetupNo changes neededGit confusion, can't push properlyNO - Current state is broken

---

Next Steps

Immediate Action Required

Option A: Proper Submodules (Recommended)

1. Run Step 4 above to check nested repo remotes
2. Create GitHub repos for any components without remotes
3. Follow Steps 5-7 to convert to proper submodules
4. Push to new main repo

Option B: Quick Monorepo (Simpler but loses history)

1. Backup current state (you have this from reorganization)
2. Remove all nested .git directories
3. Create new GitHub repo
4. Push everything as one big repo

---

Help Commands

Check Current State

bash
cd "[home]/Desktop/Computational Choreography"

# See what Git thinks about nested repos
git status | head -50

# See all nested .git directories
find . -name ".git" -type d

# Check main repo remote
git remote -v

# See if .gitmodules exists
cat .gitmodules

If Things Go Wrong

You have a backup from the reorganization:

bash
# Restore from backup if needed
cd [home-path]
tar -xzf cc-backup-*.tar.gz

---

Summary

Current State:
- ❌ Main repo points to `cc-studio.git` (wrong)
- ❌ 11 nested repos not configured as submodules
- ❌ Can't push properly (Git sees deleted files)

Recommended Solution: Git Submodules
- ✅ Formalize existing nested repos as submodules
- ✅ Create new main repo: `computational-choreography`
- ✅ Proper structure for working on entire project
- ✅ Independent component versioning

Next: Run Step 4 to check nested repo remotes, then proceed with submodule conversion.

Ready to proceed? 🚀

Promotion Decision

Keep as idea/proposal unless evidence and implementation anchors exist.

Source Anchor

projects/Documentation/03-guides/GIT_SYNC_STRATEGY.md

Detected Structure

Method · Figures · Code Anchors · Architecture