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 | ||
| info:git:homepage [2023/09/05 09:39] – [Rollback] radeff | info:git:homepage [2025/12/11 14:00] (Version actuelle) – radeff | ||
|---|---|---|---|
| Ligne 61: | Ligne 61: | ||
| fork then | fork then | ||
| - | git remote add origin git@github.com: | + | git remote add origin git@gitlab.com: |
| < | < | ||
| - | git pull git@github.com: | + | git pull git@gitlab.com: |
| git st | git st | ||
| git add... | git add... | ||
| hg commit -m " | hg commit -m " | ||
| - | git push git@github.com: | + | git push git@gitlab.com: |
| - | https://github.com/ | + | https://gitlab.com/ |
| git log | git log | ||
| #details d'un commit | #details d'un commit | ||
| git show 0943dce3be9c4a0f21c397f62ea18f78a4bcea26 | git show 0943dce3be9c4a0f21c397f62ea18f78a4bcea26 | ||
| </ | </ | ||
| - | ===== Rollback | + | ===== Branch |
| - | Revenir en arrière d'un commit | + | lister les branches: |
| + | git branch | ||
| + | ensuite changer de branche avec: | ||
| + | git checkout < | ||
| + | ===== Reset (rollback) ===== | ||
| + | <note warning> | ||
| + | |||
| + | **Revenir en arrière d'un commit** | ||
| git reset --hard HEAD^ | git reset --hard HEAD^ | ||
| Ligne 84: | Ligne 92: | ||
| doc: https:// | doc: https:// | ||
| + | ===== annuler le reset ===== | ||
| + | on vient de faire le reset //supra// et on se rend compte que c'est une grosse c...! | ||
| + | |||
| + | utiliser reflog pour trouver le bon commit: | ||
| + | |||
| + | <code bash> | ||
| + | radeff@radeff-lenovo: | ||
| + | eeb6cd2 (HEAD -> master, origin/ | ||
| + | c8fd577 HEAD@{1}: commit: minor | ||
| + | eeb6cd2 (HEAD -> master, origin/ | ||
| + | dd3b660 HEAD@{3}: clone: from REPOSITORY: | ||
| + | </ | ||
| + | |||
| + | ici, c'est donc le c8fd577 qu'on va restaurer avec cherry-pick | ||
| + | |||
| + | <code bash> | ||
| + | radeff@radeff-lenovo: | ||
| + | [master b95febf] minor | ||
| + | Date: Thu Dec 4 06:33:13 2025 +0100 | ||
| + | 13 files changed, 683 insertions(+), | ||
| + | | ||
| + | </ | ||
| + | |||
| + | ouf! petite sueur passée... | ||
| + | |||
| + | <note important> | ||
| + | ===== cherry-pick (cloner un commit d'une branche à une autre) ===== | ||
| + | git cherry-pick db6f662 | ||
| + | | ||
| + | https:// | ||
| ===== Chercher / search function ===== | ===== Chercher / search function ===== | ||
| git log --patch | git log --patch | ||
| Ligne 93: | Ligne 131: | ||
| si on veut chercher ds ttes les versions | si on veut chercher ds ttes les versions | ||
| git log -p grep ... | git log -p grep ... | ||
| - | + | ||
| doc https:// | doc https:// | ||
| ===== Branch: " | ===== Branch: " | ||
| Ligne 109: | Ligne 147: | ||
| git commit -am "My feature is ready" | git commit -am "My feature is ready" | ||
| - | Push your branch to GitLab: | + | Push your branch to Git: |
| git push origin $feature_name | git push origin $feature_name | ||
| - | voir https:// | + | doc [[gitlab]]: |
| ===== Cloner une branche spécifique ===== | ===== Cloner une branche spécifique ===== | ||
| - | git clone -b my-branch https:// | + | git clone -b my-branch https:// |
| exemple, cloner la branche stable de limesurvey et la mettre à jour | exemple, cloner la branche stable de limesurvey et la mettre à jour | ||
| - | git clone -b 2.06lts git@github.com: | + | git clone -b 2.06lts git@gitlab.com: |
| - | git pull git@github.com: | + | git pull git@gitlab.com: |
| ===== Renommer la branche master de votre dépôt Git en main ===== | ===== Renommer la branche master de votre dépôt Git en main ===== | ||
| Ligne 158: | Ligne 196: | ||
| https:// | https:// | ||
| - | ==== clés ssh ==== | ||
| - | Si vous avez un méchant message lors d'un pull ou d'un push genre: | ||
| - | < | ||
| - | Permission denied (publickey). | ||
| - | fatal: Could not read from remote repository. | ||
| - | |||
| - | Please make sure you have the correct access rights | ||
| - | and the repository exists. | ||
| - | </ | ||
| - | |||
| - | Déclarer les clés dans la section //Deploy Keys// pour le dépot: | ||
| - | |||
| - | https:// | ||
| - | |||
| - | Voir l' | ||
| === How to use "git clone" with a custom SSH key === | === How to use "git clone" with a custom SSH key === | ||
| Ligne 184: | Ligne 207: | ||
| </ | </ | ||
| + | ====== Git Cheat Sheets ====== | ||
| + | |||
| + | https:// | ||
| ====== Tutoriels ====== | ====== Tutoriels ====== | ||
| Ligne 201: | Ligne 227: | ||
| ====== git GUI ====== | ====== git GUI ====== | ||
| des clients graphiques pour git | des clients graphiques pour git | ||
| + | |||
| + | ===== Git Graph ===== | ||
| + | un plugin bien pratique pour [[info: | ||
| + | |||
| + | https:// | ||
| ===== Gitcraken / git GUI ===== | ===== Gitcraken / git GUI ===== | ||
| // | // | ||
| Ligne 210: | Ligne 241: | ||
| ===== qgit ===== | ===== qgit ===== | ||
| [[qgit]] version graphique | [[qgit]] version graphique | ||
| - | |||
| ====== GitLab ====== | ====== GitLab ====== | ||
| - | Version web libre de git avec une vue [[http:// | + | Version web libre de git qui est, lui, dans la prison CroSoft. Je n'en reviens toujours pas du nombre de librisite qui ne sont pas passés |
| - | + | ||
| - | https:// | + | |
| - | + | ||
| - | c'est le plus simple si vous ne voulez | + | |
| - | + | ||
| - | Mon espace gitlab: https:// | + | |
| - | ===== Fork ===== | + | |
| - | https:// | + | |
| - | ===== Merge / Merging request ===== | + | |
| - | https:// | + | |
| - | ===== Groups ===== | + | |
| - | https:// | + | |
| - | + | ||
| - | https:// | + | |
| - | ===== Todos / Issues ===== | + | |
| - | Système | + | |
| - | * [[https:// | + | |
| - | Utiliser gitlab | + | |
| - | * https:// | + | |
| - | ===== Doc ===== | + | |
| - | * [[https:// | + | |
| - | * [[https:// | + | |
| - | * [[https:// | + | |
| - | * https:// | + | |
| + | <note tip> | ||
| - | ===== Local install ===== | ||
| - | * [[https:// | ||
| - | * [[https:// | ||
| - | * [[https:// | ||
| - | * [[https:// | ||
| ====== Github ====== | ====== Github ====== | ||
| - | |||
| {{: | {{: | ||
| ===== Github -> gitlab ===== | ===== Github -> gitlab ===== | ||
| Ligne 261: | Ligne 262: | ||
| Credits: https:// | Credits: https:// | ||
| - | |||
| - | ===== Tips ===== | ||
| - | ==== gitlab-api ==== | ||
| - | |||
| - | https:// | ||
| Ligne 272: | Ligne 268: | ||
| * [[: | * [[: | ||
| - | {{tag> | + | {{tag> |