# 🚀 Pasos en el Servidor: Actualizar Terashe

## 📋 Proceso Completo

### Paso 1: Actualizar .gitattributes (PRIMERO)

```bash
# Conectarse al servidor y navegar al proyecto
cd /ruta/a/terashe

# Editar .gitattributes (copiar el contenido nuevo)
nano .gitattributes
# O usar el editor que prefieras
```

**Contenido a copiar:**

```gitattributes
# Auto detect text files and perform LF normalization
* text=auto

# ============================================
# Archivos protegidos del proyecto
# Estos archivos mantienen la identidad del proyecto y NO deben ser sobrescritos
# durante merges o pulls desde cd-system. Se usa estrategia "ours" para mantener
# siempre la versión del proyecto.
# ============================================

# Configuración del proyecto
config/cd-system.php merge=ours
config/site.php merge=ours

# Logos del proyecto
public/cd-project/img/logos/** merge=ours
public/cd-project/img/logos/* merge=ours

# Favicons del proyecto
public/cd-project/img/favicon/** merge=ours
public/cd-project/img/favicon/* merge=ours

# Assets temporales/backup del proyecto
public/cd-project/assets/** merge=ours
public/cd-project/assets/* merge=ours

# Skins CSS personalizados del proyecto (si existen)
# NOTA: Los skins del demo (skin-architecture-2.css, skin-law-firm-2.css, etc.)
# NO deben protegerse, solo los personalizados del proyecto
# Si tu proyecto tiene un skin personalizado, descomenta y ajusta la línea:
# public/template/css/skins/skin-mi-proyecto.css merge=ours
```

### Paso 2: Verificar .gitattributes

```bash
# Verificar que se copió correctamente
cat .gitattributes | grep "merge=ours" | wc -l
# Debe mostrar al menos 6

# Ver el contenido
cat .gitattributes
```

### Paso 3: Commit del .gitattributes (Opcional pero Recomendado)

```bash
# Agregar el archivo
git add .gitattributes

# Commitear
git commit -m "chore: Actualizar .gitattributes con protecciones optimizadas"
```

### Paso 4: Hacer Pull

```bash
# Obtener cambios desde cd-system
git pull origin cd-system
```

### Paso 5: Verificar que las Protecciones Funcionaron

```bash
# Verificar que config/cd-system.php mantiene configuración de terashe
cat config/cd-system.php | grep "demo"
# Debe mostrar el demo de terashe, NO el de cd-system

# Verificar que config/site.php mantiene identidad de terashe
cat config/site.php | grep -A 2 "'name'"
# Debe mostrar el nombre de terashe
```

### Paso 6: Limpiar Cache

```bash
php artisan config:clear
php artisan cache:clear
php artisan view:clear
```

### Paso 7: Verificar Funcionalidad

Abrir en navegador y verificar:
- ✅ Footer optimizado se muestra correctamente
- ✅ Headers tienen color consistente (#847266)
- ✅ Gallery no muestra título/descripción en hover
- ✅ Logo de terashe se mantiene
- ✅ Configuraciones de terashe se mantienen

---

## ⚡ Comando Rápido (Todo en Uno)

```bash
cd /ruta/a/terashe && \
# 1. Actualizar .gitattributes (copiar contenido manualmente) && \
# 2. Verificar
cat .gitattributes | grep "merge=ours" | wc -l && \
# 3. Commit (opcional)
git add .gitattributes && git commit -m "chore: Actualizar .gitattributes" && \
# 4. Pull
git pull origin cd-system && \
# 5. Verificar protecciones
cat config/cd-system.php | grep "demo" && \
# 6. Limpiar cache
php artisan config:clear && php artisan cache:clear && php artisan view:clear
```

---

## ⚠️ Importante

1. **Actualizar .gitattributes ANTES del pull** - Esto asegura que las protecciones estén activas
2. **Verificar después del pull** - Confirmar que las protecciones funcionaron
3. **Limpiar cache** - Siempre después de actualizar

---

## ✅ Checklist

- [ ] .gitattributes actualizado con el contenido nuevo
- [ ] .gitattributes verificado (al menos 6 protecciones)
- [ ] .gitattributes commiteado (opcional)
- [ ] `git pull origin cd-system` ejecutado
- [ ] Protecciones verificadas (config files mantienen valores de terashe)
- [ ] Cache limpiado
- [ ] Funcionalidad verificada en navegador

---

**Última actualización:** Diciembre 2024

