Files
rezepte-app/init-git.sh

62 lines
1.5 KiB
Bash
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#!/bin/bash
echo "🚀 Recipe App - Git Repository Setup"
echo "======================================"
# Prüfe ob Git installiert ist
if ! command -v git &> /dev/null; then
echo "❌ Git ist nicht installiert"
exit 1
fi
# Prüfe ob bereits ein Git-Repo existiert
if [ -d .git ]; then
echo "⚠️ Git Repository existiert bereits"
read -p "Möchtest du es neu initialisieren? (j/n): " answer
if [ "$answer" != "j" ]; then
echo "Abgebrochen"
exit 0
fi
rm -rf .git
fi
# Git Repository initialisieren
echo ""
echo "📦 Initialisiere Git Repository..."
git init
git branch -M main
# .env.example aus .env erstellen falls nicht vorhanden
if [ ! -f .env.example ] && [ -f .env ]; then
echo "📄 Erstelle .env.example..."
cp .env .env.example
fi
# Erste Dateien hinzufügen
echo " Füge Dateien hinzu..."
git add .
# Ersten Commit erstellen
echo "💾 Erstelle ersten Commit..."
git commit -m "Initial commit: Recipe App - PHP zu Node.js Migration
- Node.js 22 + Express.js Backend
- MongoDB 8 Datenbank
- Vanilla JavaScript Frontend
- Docker + Docker Compose Setup
- Komplette CRUD-Funktionalität
- Bild-Upload mit Multer
- Volltextsuche"
echo ""
echo "✅ Git Repository erfolgreich initialisiert!"
echo ""
echo "Nächste Schritte:"
echo "1. Remote Repository erstellen (GitHub/GitLab/etc.)"
echo "2. Remote hinzufügen:"
echo " git remote add origin <DEINE_REPOSITORY_URL>"
echo "3. Push zum Remote:"
echo " git push -u origin main"
echo ""
echo "📚 Mehr Infos: siehe GIT_SETUP.md"