#!/bin/bash # ============================================================================= # IDS - Fix Git Ownership Error # ============================================================================= # Risolve: "fatal: detected dubious ownership in repository" # ============================================================================= set -e GREEN='\033[0;32m' BLUE='\033[0;34m' NC='\033[0m' echo -e "${BLUE}" echo "╔═══════════════════════════════════════════════╗" echo "║ Git Ownership Fix ║" echo "╚═══════════════════════════════════════════════╝" echo -e "${NC}" # Aggiungi /opt/ids come safe directory per root echo -e "${BLUE}🔧 Configuro /opt/ids come safe directory...${NC}" git config --global --add safe.directory /opt/ids # Configura anche per utente ids sudo -u ids git config --global --add safe.directory /opt/ids echo -e "${GREEN}✅ Configurazione completata${NC}" echo "" echo "Repository configurati come safe:" git config --global --get-all safe.directory echo "" exit 0