tldr/pages.fr/common/git-apply.md

29 lines
797 B
Markdown
Raw Normal View History

2020-11-10 11:17:06 +00:00
# git apply
> Applique un correctif à un fichier et/ou à l index.
> Plus d'informations : <https://git-scm.com/docs/git-apply>.
2020-11-10 11:17:06 +00:00
- Afficher les messages à propos des fichiers corrigés :
2020-11-10 11:17:06 +00:00
`git apply --verbose {{chemin/vers/fichier}}`
- Applique le correctif et ajoute les fichiers à l index :
2020-11-10 11:17:06 +00:00
`git apply --index {{chemin/vers/fichier}}`
- Applique un correctif depuis une source distante :
2020-11-10 11:17:06 +00:00
`curl -L {{https://example.com/file.patch}} | git apply`
2020-11-10 11:17:06 +00:00
- Affiche les différences résultantes et applique le correctif :
2020-11-10 11:17:06 +00:00
`git apply --stat --apply {{chemin/vers/fichier}}`
- Applique le correctif en ordre inverse :
2020-11-10 11:17:06 +00:00
`git apply --reverse {{chemin/vers/fichier}}`
- Stocke le résultat du correctif dans l'index sans modifier la branche courante :
2020-11-10 11:17:06 +00:00
`git apply --cache {{chemin/vers/fichier}}`