Aucun fichier indexé. Utilisez git add pour indexer vos changements.
📊 Graphe de commitsbranche actuellemain
🫂 Contribution open sourceAdvanced0/6
📖 Concepts
Fork & cloneForkez le dépôt upstream sur GitHub, puis clonez votre fork en local. L'upstream est ajouté comme second remote pour pouvoir synchroniser avec le projet d'origine.
Feature branchNe jamais committer directement sur main. Créez une feature branch descriptive pour vos changements. Cela isole votre travail et facilite la relecture de la PR.
Rebase sur upstreamPendant que vous travaillez, le projet upstream peut avancer. Rebasez votre feature branch sur le dernier upstream/main pour garder l'historique linéaire et éviter des conflits dans la PR.
PR propreAvant d'ouvrir une PR, squashez vos commits en un seul changement logique avec un message descriptif. Les relecteurs apprécient un commit propre et focalisé.
📖 Histoire
Vous voulez contribuer un fix à un projet open source. Vous avez forké le repo sur GitHub et cloné votre fork en local.
Entre-temps, le projet upstream a ajouté une nouvelle feature (via fetch). Votre mission est de synchroniser avec upstream, créer une feature branch, faire votre fix, rebaser sur le dernier upstream, squasher vos commits et pusher une branche propre pour votre PR.
C'est le workflow standard de contribution open source utilisé par des millions de développeurs sur GitHub, GitLab et Bitbucket.
Voyez l'état actuel
Lancez git log --oneline --all. Le main de votre fork (HEAD) a 2 commits. L'upstream en a 3 — il a avancé avec un bump de version. Vous devez synchroniser d'abord.
● Voyez l'état actuel
○ Fetch les changements upstream
○ Créez une feature branch pour votre fix
○ Appliquez votre fix et committez
○ Rebasez votre feature branch sur upstream/main
○ Pushez votre feature branch
🧩 The HotfixNon résolu
📖 Histoire
Production is throwing errors. You already fixed the bug two days ago while working on a feature — the fix is buried in commit gggg2222 on feature/payments.
But feature/payments isn't ready to merge — it has half-finished work above the fix.
Cherry-pick just the fix commit onto main to unblock production, without bringing the unfinished work with it.
Objectif
Résolvez le problème en utilisant les bonnes commandes Git.
Terminal
🧩 Problem: The Hotfix
Production is down. A fix exists on your feature branch — get it onto main without merging the whole branch.
Use the terminal to solve the problem. Results are checked automatically.