projtec:git
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
projtec:git [2020/10/01 15:51] – [A Lire] orel | projtec:git [2024/03/18 15:06] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 203: | Line 203: | ||
Nous sommes encore dans la branche //master// comme l' | Nous sommes encore dans la branche //master// comme l' | ||
<code bash> | <code bash> | ||
- | git checkout | + | git switch |
git branch | git branch | ||
* hotfix | * hotfix | ||
Line 238: | Line 238: | ||
<code bash> | <code bash> | ||
- | git checkout | + | git switch |
date >> date2.txt | date >> date2.txt | ||
git add date2.txt | git add date2.txt | ||
Line 266: | Line 266: | ||
* d144ffa autre bla bla | * d144ffa autre bla bla | ||
(...) | (...) | ||
- | git checkout | + | git switch |
git push --set-upstream origin hotfix | git push --set-upstream origin hotfix | ||
git log --graph --oneline | git log --graph --oneline | ||
Line 318: | Line 318: | ||
</ | </ | ||
- | Expliquer le //rebase// simple : | + | Considérons le cas suivant... |
<code bash> | <code bash> | ||
- | git checkout | + | git switch |
- | git rebase master | + | git rebase master |
- | git checkout | + | git switch |
- | git merge mybranch | + | git merge mybranch |
git branch -d mybranch | git branch -d mybranch | ||
</ | </ | ||
Line 450: | Line 451: | ||
L' | L' | ||
+ | |||
+ | === Suppression d'une Branche Distante ==== | ||
+ | |||
+ | Pour supprimer une branche locale sur votre ordinateur, la commande est la suivante : | ||
+ | |||
+ | $ git branch -d [nom_de_la_branche] | ||
+ | |||
+ | Ou bien : | ||
+ | |||
+ | $ git branch -D [nom_de_la_branche] | ||
+ | |||
+ | Pour supprimer la branche située sur le dépôt distant (syntaxe récente) : | ||
+ | |||
+ | $ git push origin --delete [nom_de_la_branche] | ||
+ | |||
+ | Pour mettre à jour les changements sur un autre ordinateur, il faut faire : | ||
+ | |||
+ | $ git fetch --all -prune | ||
+ | |||
+ | => https:// | ||
+ | ==== Suppression de Commit Fautifs sur le dépôt distant ==== | ||
+ | |||
+ | Revenir à l' | ||
+ | |||
+ | $ git reset --hard <commit hash> | ||
+ | |||
+ | Forcer cet état comme le dernier état du dépôt : | ||
+ | |||
+ | $ git push --force origin master | ||
+ | | ||
+ | Attention : Ces commandes sont susceptibles d' | ||
==== Savane ==== | ==== Savane ==== | ||
Line 469: | Line 501: | ||
* https:// | * https:// | ||
+ | * https:// | ||
* https:// | * https:// | ||
* http:// | * http:// | ||
Line 475: | Line 508: | ||
* https:// | * https:// | ||
* https:// | * https:// | ||
+ | * https:// |
projtec/git.1601567503.txt.gz · Last modified: 2024/03/18 15:05 (external edit)