Configuration
git config --global user.name "Votre Nom"
git config --global user.email "email@example.com"Aide-memoire
Les commandes indispensables pour versionner, synchroniser et corriger un projet.
git config --global user.name "Votre Nom"
git config --global user.email "email@example.com"git init
git clone https://github.com/nom/repo.gitgit status
git add .
git commit -m "Message clair"git log
git log --oneline --graphgit remote add origin https://github.com/nom/repo.git
git push -u origin main
git pull origin maingit branch ma-branche
git checkout ma-branche
git checkout -b nouvelle-branchegit restore fichier
git reset --hardAttention : git reset --hard supprime les modifications locales non commitees.
| Commande | Usage |
|---|---|
git stash | Mettre de cote des changements |
git diff | Voir les differences |
git tag | Creer un repere de version |
git reflog | Retrouver des actions recentes |
git status avant de commit..env ni node_modules.