Intermédiaire · 4 min de lecture
Cherry-pick : ne prendre qu'un commit
Récupérer un correctif d'une autre branche sans merger toute la branche.
Un commit, ou une série
Le commit est copié (nouveau hash) sur ta branche actuelle. A..B prend les commits après A jusqu'à B.
Sans risque
$ git cherry-pick <commit>$ git cherry-pick <A>..<B>
Garder l'origine visible
-x ajoute « (cherry picked from commit …) » au message : utile pour les hotfix sur des branches de version.
Sans risque
$ git cherry-pick -x <commit>
Les conflits
Résous comme d'habitude, puis continue — ou annule pour revenir en arrière.
Sans risque
$ git cherry-pick --continue$ git cherry-pick --abort