informatique:git
Différences
Ci-dessous, les différences entre deux révisions de la page.
Les deux révisions précédentesRévision précédenteProchaine révision | Révision précédente | ||
informatique:git [2021/11/22 06:31] – [Des alias pour gagner du temps] alexis | informatique:git [2024/02/09 05:47] (Version actuelle) – alexis | ||
---|---|---|---|
Ligne 25: | Ligne 25: | ||
git config --global commit.template < | git config --global commit.template < | ||
git config --global alias.st ' | git config --global alias.st ' | ||
+ | git config --global push.autoSetupRemote true # Création automatique de la branche distante au moment du partage (commande " | ||
</ | </ | ||
Ligne 57: | Ligne 58: | ||
[commit] | [commit] | ||
template = < | template = < | ||
+ | [push] | ||
+ | autoSetupRemote = true | ||
</ | </ | ||
<WRAP alert> | <WRAP alert> | ||
Ligne 91: | Ligne 94: | ||
; Fixup a commit into another | ; Fixup a commit into another | ||
fixup = !sh -c 'git stash --keep-index && SHA=$(git rev-parse $1) && git commit --fixup $SHA && GIT_SEQUENCE_EDITOR=: | fixup = !sh -c 'git stash --keep-index && SHA=$(git rev-parse $1) && git commit --fixup $SHA && GIT_SEQUENCE_EDITOR=: | ||
- | ; Show file names | + | ; Show file names in commits |
list-file = !sh -c 'git diff-tree --no-commit-id --name-only -r ${1: | list-file = !sh -c 'git diff-tree --no-commit-id --name-only -r ${1: | ||
- | ; Show branch | + | ; Show branches |
last-work = branch --sort=' | last-work = branch --sort=' | ||
; Retrieve a MR locally (gitlab) | ; Retrieve a MR locally (gitlab) | ||
Ligne 104: | Ligne 107: | ||
pt = !git tag -l | xargs git tag -d && git fetch -t | pt = !git tag -l | xargs git tag -d && git fetch -t | ||
; Remove local MRs (gitlab) | ; Remove local MRs (gitlab) | ||
- | rmmr = !git checkout master && git branch --list ' | + | rmmr = !git reset --hard && |
+ | ; Show synchronized branches without remote | ||
+ | stale-branch = !git fetch --all --prune && git branch --verbose | awk '/ | ||
</ | </ | ||
<WRAP info> | <WRAP info> | ||
La commande '':'', | La commande '':'', | ||
</ | </ | ||
+ | <WRAP alert> | ||
+ | Attention, la version de //sed// disponible sur MacOS ne supporte pas l' | ||
+ | Il faut la remplacer par l' | ||
+ | </ | ||
+ | |||
<tabbox Prompt personnalisé> | <tabbox Prompt personnalisé> | ||
<WRAP todo> | <WRAP todo> | ||
Ligne 553: | Ligne 563: | ||
</ | </ | ||
+ | ===== Variables d' | ||
+ | * **GIT_SEQUENCE_EDITOR** : Cette variable surcharge l' | ||
+ | * **GIT_TERMINAL_PROMPT** (([[https:// | ||
+ | <code bash> | ||
+ | # La commande suivante va s' | ||
+ | GIT_TERMINAL_PROMPT=0 git clone https:// | ||
+ | </ | ||
===== Liens utiles ===== | ===== Liens utiles ===== | ||
Ligne 599: | Ligne 616: | ||
- [[https:// | - [[https:// | ||
- [[https:// | - [[https:// | ||
+ | - [[https:// | ||
+ | - [Et merde, Git!? | ||
+ | |||
+ | |||
<tabbox Humour> | <tabbox Humour> |
informatique/git.1637591466.txt.gz · Dernière modification : 2021/11/22 06:31 de alexis