Update git note
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
:PROPERTIES:
|
:PROPERTIES:
|
||||||
:ID: e93719b3-088d-4fe7-9ef8-fc9a4fd84827
|
:ID: e93719b3-088d-4fe7-9ef8-fc9a4fd84827
|
||||||
:mtime: 20220524205131
|
:mtime: 20221229111938
|
||||||
:ctime: 20220501191904
|
:ctime: 20220501191904
|
||||||
:END:
|
:END:
|
||||||
#+title: Git
|
#+title: Git
|
||||||
@@ -74,8 +74,32 @@ Pour créer une branche afin que celle-ci suive une distante :
|
|||||||
pull~,
|
pull~,
|
||||||
* La branche existe déjà : ~git branch -u <branche_distante> <branche_locale>~
|
* La branche existe déjà : ~git branch -u <branche_distante> <branche_locale>~
|
||||||
|
|
||||||
|
** Correction
|
||||||
|
Pour supprimer un fichier du dernier commit non /pushed/ : ~git reset --soft HEAD <filename>~.
|
||||||
|
Pour commiter la correction d'un précédent /commit/ :
|
||||||
|
#+BEGIN_SRC shell
|
||||||
|
git commit --fixup <hash_commit_à_corriger>
|
||||||
|
git rebase -i --autosquash
|
||||||
|
#+END_SRC
|
||||||
|
|
||||||
|
** Comparaison
|
||||||
|
Pour comparer deux branches : ~git diff <branche_a>..<branche_b>~.
|
||||||
|
Pour comparer un fichier ou un répertoire entre deux branches : ~git diff <branche_a>..<branche_b> -- <path>~.
|
||||||
|
Ajouter l'option ~-w~ à /git diff/ pour ignorer les espaces.
|
||||||
|
|
||||||
|
** Logs
|
||||||
|
Pour afficher l'historique d'une fonction ou d'un fichier : ~git log -L:<class_name>:<filename>~
|
||||||
|
Pour afficher les dernières positions de /HEAD/ : ~git reflog~.
|
||||||
|
|
||||||
* Outils tiers
|
* Outils tiers
|
||||||
** Visualisation
|
** Visualisation de dépôts
|
||||||
|
*** [[https://github.com/rgburke/grv/][grv]]
|
||||||
|
Visualisation de dépôts git depuis un terminal.
|
||||||
|
*** [[https://github.com/o2sh/onefetch][onefetch]]
|
||||||
|
Informations du dépôt courant au lancement d'un terminal.
|
||||||
|
*** [[https://github.com/git-up/GitUp][GitUp]]
|
||||||
|
Application de visualisation de dépôts pour MacOS.
|
||||||
|
** Visualisation de différences
|
||||||
*** [[https://github.com/dandavison/delta][Delta]]
|
*** [[https://github.com/dandavison/delta][Delta]]
|
||||||
Affichage de ~git diff~.
|
Affichage de ~git diff~.
|
||||||
*** [[https://github.com/darrenburns/dunk][Dunk]]
|
*** [[https://github.com/darrenburns/dunk][Dunk]]
|
||||||
@@ -88,4 +112,6 @@ Jeu en ligne de commande permettant d'apprendre l'usage de Git.
|
|||||||
Site permettant l'apprentissage de l'usage de Git.
|
Site permettant l'apprentissage de l'usage de Git.
|
||||||
|
|
||||||
* Références
|
* Références
|
||||||
*
|
* [[https://martinheinz.dev/blog/43][Advanced Git features you didn't know You needed - Martin Heinz]]
|
||||||
|
* [[https://medium.com/@porteneuve/getting-solid-at-git-rebase-vs-merge-4fa1a48c53aa][Getting solid at Git rebase vs. merge - Christophe Porteneuve]]
|
||||||
|
* [[https://medium.com/@porteneuve/mastering-git-reset-commit-alchemy-ba3a83bdfddc][Mastering Git Reset: Commit Alchemy - Christophe Porteneuve]]
|
||||||
|
Reference in New Issue
Block a user