Files
turf_saas/guide_gitea.html
2026-04-25 17:18:43 +02:00

292 lines
9.6 KiB
HTML
Executable File
Raw Permalink Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<!DOCTYPE html>
<html lang="fr">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Guide Git & Gitea - H3R7Tech</title>
<style>
* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: -apple-system, BlinkMacSystemFont, sans-serif; background: #0d1117; color: #c9d1d9; line-height: 1.6; padding: 20px; max-width: 900px; margin: 0 auto; }
h1 { color: #58a6ff; font-size: 2em; margin-bottom: 10px; border-bottom: 2px solid #30363d; padding-bottom: 15px; }
h2 { color: #58a6ff; margin-top: 30px; margin-bottom: 15px; font-size: 1.5em; }
h3 { color: #8b949e; margin-top: 20px; margin-bottom: 10px; }
code { background: #161b22; padding: 2px 8px; border-radius: 4px; color: #ff7b72; font-family: 'Courier New', monospace; }
pre { background: #161b22; padding: 15px; border-radius: 8px; overflow-x: auto; margin: 15px 0; border: 1px solid #30363d; }
pre code { background: none; padding: 0; color: #c9d1d9; }
.highlight { background: #1f6feb; color: #fff; padding: 2px 8px; border-radius: 4px; }
.warning { background: #3d2e00; border-left: 4px solid #d29922; padding: 15px; margin: 15px 0; border-radius: 0 8px 8px 0; }
.tip { background: #0d2e1f; border-left: 4px solid #3fb950; padding: 15px; margin: 15px 0; border-radius: 0 8px 8px 0; }
ul { margin-left: 20px; }
li { margin: 8px 0; }
a { color: #58a6ff; text-decoration: none; }
a:hover { text-decoration: underline; }
.nav { background: #161b22; padding: 15px; border-radius: 8px; margin-bottom: 30px; }
.nav a { margin-right: 20px; }
.section { background: #161b22; padding: 20px; border-radius: 12px; margin: 20px 0; border: 1px solid #30363d; }
.badge { display: inline-block; background: #238636; color: #fff; padding: 2px 8px; border-radius: 12px; font-size: 12px; margin-left: 10px; }
table { width: 100%; border-collapse: collapse; margin: 15px 0; }
th, td { border: 1px solid #30363d; padding: 10px; text-align: left; }
th { background: #21262d; color: #58a6ff; }
.home-btn{position:fixed;top:10px;left:10px;z-index:9999;background:linear-gradient(135deg,#00d9ff,#7b2cbf);color:#fff;border:none;border-radius:8px;padding:10px 15px;font-size:14px;cursor:pointer;text-decoration:none;display:flex;align-items:center;gap:8px;box-shadow:0 2px 10px rgba(0,217,255,0.3);transition:all 0.3s;font-family:-apple-system,BlinkMacSystemFont,sans-serif}.home-btn:hover{transform:translateY(-2px);box-shadow:0 4px 15px rgba(0,217,255,0.5)}
</style>
</head>
<body>
<a href="https://portal-kolifee.duckdns.org/" class="home-btn" title="Retour au portail"><span style="font-size:18px">🏠</span><span>Accueil</span></a>
<div class="nav">
<a href="#init">Init</a>
<a href="#workflow">Workflow</a>
<a href="#commands">Commandes</a>
<a href="#regles">Règles</a>
<a href="#resolution">Résolution</a>
</div>
<h1>🐙 Guide Git & Gitea - H3R7Tech</h1>
<p>Ce guide détaille les bonnes pratiques pour utiliser Git avec Gitea sur le VPS H3R7Tech.</p>
<!-- SECTION: CONFIGURATION -->
<div class="section" id="init">
<h2>⚙️ 1. Configuration Initiale</h2>
<h3>Configurer Git</h3>
<pre><code>git config --global user.name "H3R7"
git config --global user.email "h3r7@tech.local"
git config --global init.defaultBranch master
git config --global pull.rebase false</code></pre>
<h3>Cloner un Repo</h3>
<pre><code># Via HTTPS (recommandé pour automate)
git clone /gitea/admin/h3r7tech.git
# Via SSH (pour developement)
git clone git@178.18.250.53:admin/h3r7tech.git</code></pre>
</div>
<!-- SECTION: WORKFLOW -->
<div class="section" id="workflow">
<h2>🔄 2. Workflow Standard</h2>
<div class="tip">
<strong>💡 Règle d'or:</strong> Toujours travailler sur la branche <code>dev</code> pour les développe­ments, puis fusionner vers <code>master</code> pour la production.
</div>
<h3>Schéma du Workflow</h3>
<pre><code>master (production)
└── dev (développement)
└── feature/xyz (nouvelle功能)
</code></pre>
<h3>Créer une Feature</h3>
<pre><code># 1. Se placer sur dev
git checkout dev
# 2. Mettre à jour dev
git pull origin dev
# 3. Créer une branche feature
git checkout -b feature/nom-feature
# 4. Travailler sur la功能...
git add .
git commit -m "Description claire du changement"
# 5. Pousser sur Gitea
git push origin feature/nom-feature</code></pre>
</div>
<!-- SECTION: COMMANDES -->
<div class="section" id="commands">
<h2>⌨️ 3. Commandes Essentielles</h2>
<table>
<tr>
<th>Action</th>
<th>Commande</th>
</tr>
<tr>
<td>Statut actuel</td>
<td><code>git status</code></td>
</tr>
<tr>
<td>Voir les changements</td>
<td><code>git diff</code></td>
</tr>
<tr>
<td>Ajouter fichiers</td>
<td><code>git add .</code></td>
</tr>
<tr>
<td>Commit avec message</td>
<td><code>git commit -m "message"</code></td>
</tr>
<tr>
<td>Voir historique</td>
<td><code>git log --oneline -10</code></td>
</tr>
<tr>
<td>Basculer branche</td>
<td><code>git checkout nom-branche</code></td>
</tr>
<tr>
<td>Fusionner dev → master</td>
<td><code>git checkout master && git merge dev</code></td>
</tr>
<tr>
<td>Annuler dernier commit</td>
<td><code>git reset --soft HEAD~1</code></td>
</tr>
</table>
</div>
<!-- SECTION: REGLES -->
<div class="section" id="regles">
<h2>📋 4. Règles de Bon Usage</h2>
<h3>Messages de Commit</h3>
<ul>
<li><code>git commit -m "Ajout filtre catégorie CRM"</code></li>
<li><code>git commit -m "Fix bug render() surCRM"</code></li>
<li><code>git commit -m "modif"</code></li>
<li><code>git commit -m "fix"</code></li>
</ul>
<h3>Fréquence de Push</h3>
<div class="tip">
<strong>Push fréquent:</strong> Au moins 1x/jour ou à chaque功能 complète.
</div>
<h3>Protection Branches</h3>
<table>
<tr>
<th>Branche</th>
<th>Règle</th>
</tr>
<tr>
<td><code>master</code></td>
<td>lecture seule, push via merge depuis dev uniquement</td>
</tr>
<tr>
<td><code>dev</code></td>
<td>push autorisé après tests locaux</td>
</tr>
<tr>
<td><code>feature/*</code></td>
<td>push fréquent, supprimée après merge</td>
</tr>
</table>
</div>
<!-- SECTION: RESOLUTION CONFLITS -->
<div class="section" id="resolution">
<h2>🔧 5. Résolution des Conflits</h2>
<div class="warning">
<strong>⚠️ Avant un merge:</strong> Toujours pull la dernière version!
</div>
<h3>En cas de conflit</h3>
<pre><code># 1. Mettre à jour dev
git checkout dev
git pull origin dev
# 2. Fusionner dans votre branche
git checkout feature/ma-branche
git merge dev
# 3. Résoudre les conflits manuellement
# (éditer les fichiers en conflit)
# 4. Ajouter les fichiers résolus
git add .
git commit -m "Résolution conflits merge dev"
git push origin feature/ma-branche</code></pre>
<h3>Méthode Alternative: Rebase</h3>
<pre><code>#Instead de merge, utiliser rebase pour historique propre
git checkout feature/ma-branche
git rebase dev</code></pre>
</div>
<!-- SECTION: PRATIQUE -->
<div class="section" id="pratique">
<h2>📝 6. Exemple Pratique</h2>
<h3>Modifier le CRM sur le VPS</h3>
<pre><code># Connexion SSH
ssh -i /path/to/key h3r7@178.18.250.53
# Aller dans le dossier projet
cd /home/h3r7
# Bas/turf_scraperculer sur dev
git checkout dev
# Mettre à jour
git pull origin dev
# Créer branche pour la功能
git checkout -b fix/crm-filtre
# ... Faire les modifications ...
# Commit
git add crm_dashboard.html
git commit -m "Corrige filtre catégorie CRM"
# Pousser
git push origin fix/crm-filtre</code></pre>
<h3>Créer une Pull Request</h3>
<ol>
<li>Aller sur <a href="/gitea/admin/h3r7tech" target="_blank">Gitea</a></li>
<li>Cliquer sur "Pull Requests" → "New Pull Request"</li>
<li>Sélectionner: <code>fix/crm-filtre</code><code>dev</code></li>
<li>Décrire les changements</li>
<li>Valider le merge après review</li>
</ol>
</div>
<!-- SECTION: OUTILS -->
<div class="section" id="outils">
<h2>🛠️ 7. Accès Rapides</h2>
<table>
<tr>
<th>Service</th>
<th>URL</th>
</tr>
<tr>
<td>Gitea</td>
<td><a href="/gitea/" target="_blank">/gitea/</a></td>
</tr>
<tr>
<td>Repo H3R7Tech</td>
<td><a href="/gitea/admin/h3r7tech" target="_blank">/gitea/admin/h3r7tech</a></td>
</tr>
<tr>
<td>CRM Prod</td>
<td><a href="/crm/" target="_blank">/crm/</a></td>
</tr>
<tr>
<td>CRM Dev</td>
<td><a href="/crm/" target="_blank">/crm/</a></td>
</tr>
<tr>
<td>Dashboard Turf</td>
<td><a href="/turf/" target="_blank">/turf/</a></td>
</tr>
</table>
</div>
<div class="section" style="text-align: center; margin-top: 40px;">
<p style="color: #8b949e;">Guide Git & Gitea - H3R7Tech © 2026</p>
<p style="color: #58a6ff;">🐾 Version 1.0</p>
</div>
</body>
</html>