# .gitconfig # Par Lilian Besson, # Inspiré de http://perso.crans.org/respbats/config/.gitconfig [user] name = Lilian Besson email = lbesson@ens-cachan.fr signingkey = 01AACDB9C108F8A0 [bitbucket] user = lbesson email = lbesson@ens-cachan.fr [github] user = naereen email = naereen@crans.org [color] # Afficher les couleurs sur les commandes interactive (ex: git add -p) interactive = true # Afficher les couleurs sur les autres commandes (ex: git diff) # ui = true ui = always [color "branch"] current = yellow bold local = green bold remote = cyan bold [color "diff"] meta = yellow bold frag = magenta bold old = red bold new = green bold whitespace = red reverse [color "status"] added = green bold changed = yellow bold untracked = red bold [diff] tool = colordiff [difftool] prompt = false [alias] lg = log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --date=relative lgt = log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit c = commit -a -m s = status pom = push -u origin master co = checkout -- p = push d = diff -w # Pour diff ou show en affichant les modifs sur la même ligne # (difficile de voir ce qui se passe en l'absence de couleurs) wdiff = diff --color-words -w wshow = show --color-words -w dsf = "!f() { [ -z \"$GIT_PREFIX\" ] || cd \"$GIT_PREFIX\" && git diff --color \"$@\" | diff-so-fancy | less --tabs=4 -RFX; }; f" # https://csswizardry.com/2017/05/little-things-i-like-to-do-with-git/ today = log --since=00:00:00 --all --no-merges home = rev-parse --show-toplevel whereami = rev-parse --abbrev-ref HEAD [help] # Quand on écrit mal une commande git, il propose "did you mean ?" avec # plusieurs proposition. Cette option fait que, # si il n'y a qu'un seul choix, il l'utilise au bout de 0.5 secondes autocorrect = 5 [push] default = simple [ui] ssh = ssh -C [core] # Failed to use diff-so-fancy... # pager = diff-highlight | diff-so-fancy | less -r pager = diff-highlight | less -r [color "diff-highlight"] oldNormal = red bold oldHighlight = red bold 52 newNormal = green bold newHighlight = green bold 22 [alias] showtool = "!f() { git difftool $1^ $1; }; f" added = difftool --cached [diff] tool = icdiff [difftool] prompt = false [difftool "icdiff"] cmd = /usr/local/bin/icdiff --line-numbers $LOCAL $REMOTE [pager] difftool = true