Skip to content

Instantly share code, notes, and snippets.

@VonC
Last active May 19, 2018 08:51
Show Gist options
  • Save VonC/972690 to your computer and use it in GitHub Desktop.
Save VonC/972690 to your computer and use it in GitHub Desktop.
My global git config
[user]
name = VonC
email = [email protected]
[core]
; just making sure those eol's stay as they are
autocrlf = false
; see http://stackoverflow.com/a/22208863/6309 (Git/Bash is extremely slow in Windows 7 x64, until fix in msysgit 1.9.4)
fscache = true
[alias]
; from http://www.jukie.net/bart/blog/pimping-out-git-log, with author displayed
lg = log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --date=relative
lgb = log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --date=relative --branches
lga = log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --date=relative --all
lgba = log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --date=relative --branches --all
st=status
br=branch
ignore = update-index --assume-unchanged
unignore = update-index --no-assume-unchanged
aliases=config --get-regexp 'alias.*' | colrm 1 6 | sed 's/[ ]/ = /' | awk '{printf 033[1;31m 033[0m; =; print bin/bash;}'
lo=!sh -c 'git log $1' -
; from http://stackoverflow.com/a/11768870/6309
change-commits=!f() { VAR=$1; OLD=$2; NEW=$3; shift 3; git filter-branch --env-filter "if [[ $`echo $VAR` = \"$OLD\" ]]; then export $VAR=\"$NEW\"; fi" $@; }; f
[color]
; I want colors!
ui = always
[github]
user = VonC
token = 012345...
[http]
sslcainfo = /home/username/.ssh/curl-ca-bundle.crt
[push]
default = simple
[rebase]
; see http://stackoverflow.com/a/30209750: git 2.6+ for git pull --rebase
autoStash = true
@VonC
Copy link
Author

VonC commented Jun 26, 2011

Main alias and settings I always want when working with Git on any repo: this file is a global git config, made to be copy-pasted in ~/.gitconfig (Unix or Windows, where %HOME% can be defined to be any directory you want, not always C:\Users\YourName)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment