Créer et changer de branche
switch -c crée une branche à partir du commit courant. switch - revient à la branche précédente. branch -d protège les branches dont les modifications restent à fusionner.
git branch -vv
git switch -c feature/docs
git switch main
git switch -
git branch --merged main
git branch -d feature/docs
Intégrer les modifications et résoudre les conflits
Depuis votre branche de travail, vous pouvez fusionner origin/main. En cas de conflit, modifiez les fichiers, indexez-les et poursuivez la fusion. Utilisez --abort pour l’annuler.
git fetch origin
git merge origin/main
git status
git add -- README.md
git merge --continue
git merge --abort
Appliquer un commit précis
cherry-pick applique les modifications d’un commit à la branche courante. Remplacez abc1234 par son identifiant.
git show abc1234
git cherry-pick abc1234