← Retour au tableau de bord
Procédure Git · v1.0

Git & GitHub

Gitflow, scripts PowerShell Windows, Conventional Commits et pipeline CI/CD.

Stratégie de branches

Gitflow Harambee

main ← Production stable (tags: v1.0, v1.5, v2.0…) └── develop ← Intégration continue (base de toutes les features) ├── feature/auth-kyc ← Développement actif ├── feature/marketplace ← En attente de review ├── feature/paiements-wave ← En attente de merge ├── release/v1.0 ← Préparation release └── hotfix/fix-kyc-score ← Correctif urgent production
BrancheOrigineMerge versDurée de vie
mainPermanente — uniquement via release/* ou hotfix/*
developmainPermanente — base de développement
feature/*developdevelopDurée du développement de la feature
release/*developmain + developPériode de stabilisation (2–5 jours)
hotfix/*mainmain + developUrgence — correctif en production (< 24h)

Scripts PowerShell Windows

Script 1 — Initialisation du dépôt

Exécuter une seule fois pour initialiser le projet Harambee sur GitHub.

init_wara_git.ps1 PowerShell — Exécuter en tant qu'Admin
# ── INIT Harambee GIT ──────────────────────────────────────────
# Prérequis : Git installé, GitHub CLI (gh) configuré
# Exécuter depuis : C:\xampp\htdocs\WARA\laravel\

Set-ExecutionPolicy RemoteSigned -Scope CurrentUser -Force

# Naviguer dans le dossier Laravel
cd C:\xampp\htdocs\WARA\laravel

# Initialiser git et configurer l'identité
git init
git config user.name  "Blesh Harambee"
git config user.email "serilo@looky.org"

# Créer .gitignore Laravel standard
Add-Content .gitignore "/vendor`n/node_modules`n.env`n.env.*`n!.env.example`n/storage/*.key`n/public/build"

# Premier commit sur main
git add .
git commit -m "chore(init): initialisation projet Harambee Laravel 11"

# Créer et pousser vers GitHub
gh repo create Blesh-Lab/Harambee --private --source=. --remote=origin --push

# Créer la branche develop
git checkout -b develop
git push origin develop

Write-Host "✅ Dépôt Harambee initialisé avec succès !" -ForegroundColor Green

Script 2 — Workflow quotidien (feature)

new_feature.ps1 Paramètre : nom de la feature (ex: auth-kyc)
# ── NOUVELLE FEATURE ───────────────────────────────────────
# Usage : .\new_feature.ps1 auth-kyc

param(
  [Parameter(Mandatory=$true)]
  [string]$FeatureName
)

cd C:\xampp\htdocs\WARA\laravel

# S'assurer d'être à jour sur develop
git checkout develop
git pull origin develop

# Créer la branche feature
git checkout -b "feature/$FeatureName"
Write-Host "✅ Branche feature/$FeatureName créée" -ForegroundColor Cyan

# ... développement ...
# Quand la feature est prête :

git add .
git status

$msg = Read-Host "Message de commit (type(scope): description)"
git commit -m $msg
git push origin "feature/$FeatureName"

# Ouvrir une Pull Request sur GitHub
gh pr create --base develop --title "[$FeatureName] $(git log -1 --pretty=%s)" --body "## Changements

- [ ] Tests passants
- [ ] Charte graphique respectée
- [ ] OWASP vérifié

## Comment tester"

Write-Host "✅ Pull Request créée sur GitHub !" -ForegroundColor Green

Script 3 — Release

release.ps1 Paramètre : version (ex: 1.0.0)
# ── RELEASE Harambee ───────────────────────────────────────────
# Usage : .\release.ps1 1.0.0

param([string]$Version = "1.0.0")

cd C:\xampp\htdocs\WARA\laravel

# Créer la branche release
git checkout develop
git pull origin develop
git checkout -b "release/v$Version"

# Mettre à jour le numéro de version
(Get-Content config/app.php) -replace "'version' => '.*'", "'version' => 'v$Version'" |
  Set-Content config/app.php

git add config/app.php
git commit -m "chore(release): bump version to v$Version"

# Merger dans main et taguer
git checkout main
git merge "release/v$Version" --no-ff -m "chore(release): merge release/v$Version into main"
git tag -a "v$Version" -m "Release v$Version"
git push origin main --tags

# Synchroniser develop
git checkout develop
git merge "release/v$Version" --no-ff -m "chore(release): back-merge v$Version to develop"
git push origin develop

# Créer la GitHub Release
gh release create "v$Version" --title "Harambee v$Version" --generate-notes

Write-Host "🚀 Release v$Version publiée !" -ForegroundColor Green

Conventions

Conventional Commits

Format : type(scope): description courte

TypeUsageExemple
featNouvelle fonctionnalitéfeat(kyc): ajout scoring risque automatique
fixCorrection de bugfix(investissement): plafond diaspora incorrect
choreMaintenance, scripts, configchore(deps): upgrade Laravel 11.x → 11.y
docsDocumentationdocs(architecture): mise à jour schéma DB
testAjout / correction de teststest(kyc): ajout cas PPE et sanctions
refactorRefactoring sans changement fonctionnelrefactor(services): extraction InvestissementService
styleFormatage, espaces (pas de logique)style(models): PSR-12 Project model
perfOptimisation de performanceperf(marketplace): index composite sur offers
ciChangements pipeline CI/CDci(github): ajout step coverage check

CI/CD

Pipeline GitHub Actions

.github/workflows/ci.yml Déclenché sur push et pull_request
name: Harambee CI

on:
  push:
    branches: [main, develop]
  pull_request:
    branches: [develop]

jobs:
  test:
    runs-on: ubuntu-latest
    services:
      postgres:
        image: postgres:16
        env:
          POSTGRES_DB: wara_test
          POSTGRES_USER: wara
          POSTGRES_PASSWORD: secret
        ports: ["5432:5432"]

    steps:
      - uses: actions/checkout@v4
      - uses: shivammathur/setup-php@v2
        with:
          php-version: '8.2'
          coverage: xdebug

      - name: Install dependencies
        run: composer install --no-interaction --prefer-dist

      - name: Copy .env
        run: cp .env.testing .env && php artisan key:generate

      - name: Run tests with coverage
        run: php artisan test --coverage --min=80

      - name: PHP CS Fixer (PSR-12)
        run: vendor/bin/php-cs-fixer fix --dry-run --diff