Git Alias Supporting tagline
Objectifs
Définir un ensemble d’alias pour mes commandes les plus courantes.
J’insiste sur “mes commandes” car le besoin en alias dépend de la manière de chacun d’utiliser Git (workflow, IDE, ligne de commande, …).
Création d’alias
Syntaxe pour créer un alias:
git config [--global] alias.<alias_name> "<command_git>"
ex:
git config --global alias.mylog "log --pretty=format : '%h %s [%an]' --graph"
Mes alias
Pour les branches
co = checkout
cob = checkout -b
cobt = checkout -b temp
dbt = branch -d temp
Pour les commits
cm = commit -a -m
cmq = commit -a -m 'SAVEPOINT'
Pour l’affichage des logs
la = log --pretty=oneline
gf = log --graph --full-history --all --pretty=format:'%h%x09%d%x20%s'
Divers
psa = push --all
Ma rubric [alias] de .gitconfig
....
[alias]
co = checkout
cob = checkout -b
cobt = checkout -b temp
dbt = branch -d temp
cm = commit -a -m
cmq = commit -a -m 'SAVEPOINT'
la = log --pretty=oneline
gf = log --graph --full-history --all --pretty=format:'%h%x09%d%x20%s'
psa = push --all