tldr/pages.fr/common/git-cherry-pick.md

22 lines
775 B
Markdown
Raw Normal View History

2020-11-10 11:17:06 +00:00
# git cherry-pick
> Appliquer les modifications introduites par les commits existants à la branche actuelle.
> Pour appliquer les changements a une autre branche, utiliser d'abord `git checkout` pour basculer sur la branche désirée.
> Plus d'informations : <https://git-scm.com/docs/git-cherry-pick>.
2020-11-10 11:17:06 +00:00
- Applique un commit à la branche courante :
2020-11-10 11:17:06 +00:00
`git cherry-pick {{commit}}`
- Appliquer une plage de commits à la branche courante (voir aussi `git rebase --onto`) :
2020-11-10 11:17:06 +00:00
`git cherry-pick {{start_commit}}~..{{end_commit}}`
- Appliquer plusieurs commits non séquentiels à la branche courante :
2020-11-10 11:17:06 +00:00
`git cherry-pick {{commit_1}} {{commit_2}}`
- Appliquer les changements d'un commit à la branche courante sans créer de commit :
2020-11-10 11:17:06 +00:00
`git cherry-pick --no-commit {{commit}}`