coffreobsidian/command_list/Git commands.md
2025-03-24 17:36:01 +01:00

27 lines
3.1 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

---
---
---
## 🧠 Tableau récapitulatif des commandes Git utiles
| Commande Git | Utilité |
| -------------------------------------------------------------------------------------------------- | --------------------------------------------------------------- |
| `git status` | Affiche les fichiers modifiés |
| `git add .` | Ajoute tous les fichiers à lindex |
| `git commit -m "message"` | Enregistre les changements avec un message |
| `git push` | Envoie les changements sur GitHub |
| `git pull` | Récupère les derniers changements |
| `git branch` | Liste les branches locales |
| `git switch <branche>` | Change de branche |
| `git checkout -b <branche>` | Crée et bascule sur une nouvelle branche |
| `git log --oneline` | Historique rapide des commits |
| `git stash` / `pop` | Sauvegarde temporaire de changements |
| git fetch origin<br>git reset --hard origin/nom_de_la_branche_distante` | Ecrase ta branche locale avec le contenu de la branche distante |
| git checkout -b nouvelle_branche<br>git fetch origin<br>git reset --hard origin/stable-version<br> | nouvelle_branche identique à origin/stable-version |
| git remote -v | URL du dépôt distant |
| git fetch origin<br>git merge origin/nom_de_la_branche | Mettre à jour une branche locale depuis un dépôt distant |
| git fetch origin<br>git reset --hard origin/nom_de_la_branche<br> | Mettre à jour en écrasant les modifications locales |
| git fetch --prune | Nettoie les fichiers obsolètes |
---