151 lines
5.9 KiB
Bash
Executable File
151 lines
5.9 KiB
Bash
Executable File
#!/bin/bash
|
|
# Quick-Start Guide für sync-home-content.sh
|
|
|
|
cat << 'EOF'
|
|
|
|
╔════════════════════════════════════════════════════════════════════════════╗
|
|
║ Quick-Start: home-content Synchronisierung ║
|
|
╚════════════════════════════════════════════════════════════════════════════╝
|
|
|
|
📋 KURZVERSION (3 Schritte):
|
|
|
|
1. Status prüfen:
|
|
./sync-home-content.sh status
|
|
|
|
2. Trockentest:
|
|
./sync-home-content.sh sync --dry-run
|
|
|
|
3. Synchronisieren:
|
|
./sync-home-content.sh sync
|
|
|
|
|
|
═══════════════════════════════════════════════════════════════════════════════
|
|
|
|
🎯 Welcher Modus passt?
|
|
|
|
┌─ Lokal neue .gitconfig erstellt / bearbeitet
|
|
│ → ./sync-home-content.sh pull
|
|
│
|
|
├─ Git-Pull durchgeführt, Repo hat Updates
|
|
│ → ./sync-home-content.sh push
|
|
│
|
|
├─ "Weiß nicht, was geändert wurde" (safer)
|
|
│ → ./sync-home-content.sh sync
|
|
│
|
|
├─ Nur schauen, nicht ändern
|
|
│ → ./sync-home-content.sh status
|
|
│
|
|
└─ Alte Backups löschen (>30 Tage)
|
|
→ ./sync-home-content.sh cleanup
|
|
|
|
|
|
═══════════════════════════════════════════════════════════════════════════════
|
|
|
|
🛡️ IMMER SO:
|
|
|
|
TROCKENTEST vor echter Änderung:
|
|
./sync-home-content.sh [modus] --dry-run
|
|
|
|
Dann mit -v (verbose) um Details zu sehen:
|
|
./sync-home-content.sh [modus] --dry-run -v
|
|
|
|
|
|
═══════════════════════════════════════════════════════════════════════════════
|
|
|
|
💾 BACKUPS:
|
|
|
|
Alle Backups sind in: .sync-backups/
|
|
|
|
Restore eines Backups:
|
|
cp .sync-backups/.gitconfig.20260928_150000.backup home-content/.gitconfig
|
|
|
|
Alte Backups löschen:
|
|
./sync-home-content.sh cleanup
|
|
|
|
|
|
═══════════════════════════════════════════════════════════════════════════════
|
|
|
|
📝 CHECKLISTE für Anfänger:
|
|
|
|
☐ Stehe im Verzeichnis: ~/mac-home
|
|
☐ Führe Status aus: ./sync-home-content.sh status
|
|
☐ Lese die Zusammenfassung sorgfältig
|
|
☐ Führe mit --dry-run aus: ./sync-home-content.sh [modus] --dry-run
|
|
☐ Stimmst du mit den Änderungen überein? (JA → nächster Schritt)
|
|
☐ Führe ohne --dry-run aus: ./sync-home-content.sh [modus]
|
|
☐ Prüfe Logs: tail .sync-home-content.log
|
|
☐ Backups prüfen: ls -la .sync-backups/
|
|
|
|
|
|
═══════════════════════════════════════════════════════════════════════════════
|
|
|
|
⚡ HÄUFIGE SZENARIEN:
|
|
|
|
1️⃣ Neue dotfiles lokal bearbeitet → Repo speichern
|
|
|
|
./sync-home-content.sh status # Was wurde geändert?
|
|
./sync-home-content.sh pull --dry-run # Trockentest
|
|
./sync-home-content.sh pull # Echte Sync
|
|
cd home-content && git commit -am "Update" && git push
|
|
|
|
2️⃣ Git-Update von Team → Lokal anwenden
|
|
|
|
git pull # Repository updaten
|
|
./sync-home-content.sh push --dry-run # Trockentest
|
|
./sync-home-content.sh push # Echte Sync
|
|
source ~/.zshrc # (bei .zshrc) neuladen
|
|
|
|
3️⃣ "Ich weiß nicht was los ist" (safest)
|
|
|
|
./sync-home-content.sh sync --dry-run -v # Ausführlich sehen
|
|
./sync-home-content.sh sync # Bidirektional lösen
|
|
|
|
4️⃣ Ich habe versehentlich was kaputt gemacht
|
|
|
|
ls -lh .sync-backups/ # Backup finden
|
|
cp .sync-backups/DATEI.*.backup home-content/DATEI
|
|
./sync-home-content.sh push # Restore
|
|
|
|
|
|
═══════════════════════════════════════════════════════════════════════════════
|
|
|
|
❓ FRAGEN:
|
|
|
|
Q: Verliere ich lokale Änderungen?
|
|
A: NEIN! Es wird immer ein Backup erstellt bevor überschrieben wird.
|
|
.sync-backups/ enthält die alten Versionen.
|
|
|
|
Q: Was ist der Unterschied pull vs push?
|
|
A: PULL = Home → Repo (lokale Änderungen ins Repository)
|
|
PUSH = Repo → Home (Repository ins lokale Home-Dir)
|
|
|
|
Q: Kann ich mehrere Dateien gleichzeitig mit --dry-run testen?
|
|
A: JA! --dry-run tut nix, du kannst mehrmals hintereinander testen.
|
|
|
|
Q: Wie oft sollte ich cleanup laufen lassen?
|
|
A: Monatlich ist sinnvoll. Script löscht nur Backups >30 Tage.
|
|
|
|
Q: Kann ich es automatisieren (Cron)?
|
|
A: JA! Aber nutze `sync` mode im non-interactive (Standard).
|
|
Im .sync-backups musst du selbst aufräumen.
|
|
|
|
|
|
═══════════════════════════════════════════════════════════════════════════════
|
|
|
|
🔗 WEITERE INFOS:
|
|
|
|
Detaillierte Doku: SYNC-STRATEGY.md
|
|
Logs: .sync-home-content.log
|
|
Hilfe: ./sync-home-content.sh -h
|
|
|
|
|
|
═══════════════════════════════════════════════════════════════════════════════
|
|
|
|
🚀 READY? Let's go:
|
|
|
|
cd ~/mac-home
|
|
./sync-home-content.sh status
|
|
|
|
EOF
|
|
|