Différences
Ci-dessous, les différences entre deux révisions de la page.
Les deux révisions précédentes Révision précédente Prochaine révision | Révision précédente | ||
technique:git:accueil [2019/04/15 16:54] – lolo | technique:git:accueil [2024/04/02 15:08] (Version actuelle) – modification externe 127.0.0.1 | ||
---|---|---|---|
Ligne 15: | Ligne 15: | ||
* [[https:// | * [[https:// | ||
* [[https:// | * [[https:// | ||
+ | |||
+ | ===== Aide ===== | ||
+ | |||
+ | pour avoir la liste des options/ | ||
+ | |||
+ | git help | ||
+ | |||
+ | git help -a | ||
+ | |||
+ | git help commande | ||
+ | |||
+ | git commande -h | ||
+ | |||
+ | </ | ||
+ | |||
+ | ===== Quelques commandes git de base ===== | ||
+ | |||
+ | Initialisation d'un dossier utilisé pour git (permet de faire des commits) | ||
+ | |||
+ | < | ||
+ | git init dossier | ||
+ | |||
+ | </ | ||
+ | |||
+ | Créer les infos concernant l' | ||
+ | |||
+ | < | ||
+ | git config --local user.name "Mon nom simplifié / pseudo" | ||
+ | git config --local user.email " | ||
+ | |||
+ | </ | ||
+ | |||
+ | Ajout d'un fichier / dossier / tout au stagging | ||
+ | |||
+ | < | ||
+ | git add fichier | ||
+ | git add dossier | ||
+ | git add . | ||
+ | |||
+ | </ | ||
+ | |||
+ | Créer un commit | ||
+ | |||
+ | < | ||
+ | git commit -m " | ||
+ | |||
+ | </ | ||
+ | |||
+ | Envoyer les commit au repository distant | ||
+ | |||
+ | < | ||
+ | git push | ||
+ | |||
+ | </ | ||
+ | |||
+ | Récupérer les dernières modifs issues du dépot | ||
+ | |||
+ | < | ||
+ | git pull | ||
+ | |||
+ | </ | ||
+ | |||
+ | Récupérer une copie locale d'un repository | ||
+ | |||
+ | < | ||
+ | git clone https:// | ||
+ | |||
+ | </ | ||
+ | |||
+ | Avoir des infos sur le dépot en cours | ||
+ | |||
+ | < | ||
+ | git status | ||
+ | |||
+ | </ | ||
+ | |||
+ | Avoir des infos sur les commits existants | ||
+ | |||
+ | < | ||
+ | git log | ||
+ | |||
+ | </ | ||
+ | |||
+ | Avoir de l'aide | ||
+ | |||
+ | < | ||
+ | git help / git help commande | ||
+ | |||
+ | </ | ||
+ | |||
+ | Ajouter un " | ||
+ | |||
+ | < | ||
+ | git tag " | ||
+ | |||
+ | </ | ||
+ | |||
+ | ===== Branches et autres - à compléter avec détails ===== | ||
+ | |||
+ | Créer une autre branche et basculer dessus | ||
+ | |||
+ | < | ||
+ | git rm fichier-ou-dossier #supprimer fichier-dossier lors du prochain commit | ||
+ | |||
+ | git mv fichier-ou-dossier #renommer fichier-dossier lors du prochain commit | ||
+ | |||
+ | git branch -b nouvellebranche | ||
+ | |||
+ | git diff commit1 commit2 # | ||
+ | |||
+ | git checkout | ||
+ | |||
+ | git reset | ||
+ | |||
+ | git rebase | ||
+ | |||
+ | </ | ||