Skip to content

Instantly share code, notes, and snippets.

Last active June 16, 2022 12:32
  • Star 12 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
# This is a snapshot of my ~/.gitconfig file, minus a few bits
# that are obsolete or non-reusable.
# For explanation of each setting, see `git help config`
# or .
name = Greg Price
email =
st = status
di = diff
ls = ls-files
ci = commit
dc = diff --cached
rc = rebase --continue
ca = commit --amend
git = !git
testci = "!testci () { echo $1 >$1 && git add $1 && git commit -m $1; }; testci"
k = log --decorate --oneline --graph --boundary
pff = pull --ff-only
co = checkout
mff = merge --ff-only
refs = for-each-ref --format=%(refname)
kk = log --graph --boundary --pretty=format:'%Cred%h%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>'
s = status --short
view = log --decorate --oneline --graph --boundary --all HEAD
lv = log --decorate --oneline --graph --boundary --branches HEAD --not --tags --remotes=origin --remotes=upstream --not
lvm = log --decorate --oneline --graph --boundary --branches HEAD --remotes=me --not --tags --remotes=origin --remotes=upstream --not
rac = !git add -u && git rebase --continue
lsp = log --stat -p
usp = log --stat -p @{u}.. --reverse
uv = log --decorate --oneline --graph --boundary @{u}..
rh = reset --hard
# Makes useful headings to paste into a GitHub review.
rv = "!f () { range=${1:-@{u\\}..}; git log --reverse --format='#### %h %s%n%n%n%n' \"$range\"; }; f"
ui = auto
default = current
conflictstyle = diff3
defaultToUpstream = true
stat = true
excludesfile = ~/.gitexclude
pager = LESS=-iRFX less
abbrev = 9
commitgraph = true
# These require installing `diff-highlight` on your PATH.
# Handy for making diffs easier to read.
# log = diff-highlight | LESS=-iRFX less
# show = diff-highlight | LESS=-iRFX less
# diff = diff-highlight | LESS=-iRFX less
# diffFilter = diff-highlight
# This is a handy feature, when it occasionally comes into action...
# but awfully surprising if you're not expecting it.
# Best enabled only after reading `git help rerere`.
# enabled = true
# These require having the respective programs installed on your PATH.
# They're also only relevant if you have files in the respective formats.
#[diff "ipynb"]
# textconv = jupyter nbconvert --to markdown --stdout --log-level=0
# cachetextconv = true
#[diff "doc"]
# textconv = antiword
# cachetextconv = true
#[diff "odf"]
# textconv = odt2txt
# cachetextconv = true
mailmap = true
thread = shallow
autosetupmerge = always
rebase = true
noprefix = true
# Use color to identify code that was moved around verbatim.
# Enable the feature.
colorMoved = zebra
# Supercharge it to do the equivalent of `git diff -b`.
# The ideal criterion would be pure leading-whitespace changes;
# but "allow-indentation-change" actually allows whitespace
# changes anywhere, even breaking up words.
colorMovedWS = ignore-space-change
[color "diff"]
# The default colors stay within the classic 16-color palette,
# which is pretty constraining: old/"-" lines are bold magenta
# or bold blue, and new/"+" lines are cyan or yellow. With a
# modern terminal emulator, we can do much better.
# Our approach: Old/"-" and new/"-" lines should be in reddish
# and greenish hues, consistent with non-moved code.
# We also add a faint gray (or yellow-gray) background, to
# help mark it as moved in a way that reduces emphasis --
# assuming a black terminal background. If using a light
# terminal background, then substituting light gray in these
# backgrounds should give the same effect.
oldMoved = "#ff0077 #222222"
oldMovedAlternative = "#ff3322 #222a00"
newMoved = "#00cc77 #222222"
newMovedAlternative = "#66aa00 #222a00"
reflogExpire = never
reflogExpireUnreachable = never
writecommitgraph = true
[url ""]
insteadOf = salsa:
[url ""]
insteadOf = gh:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment