Skip to content

Instantly share code, notes, and snippets.

@esc
Last active December 22, 2015 02:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save esc/6403489 to your computer and use it in GitHub Desktop.
Save esc/6403489 to your computer and use it in GitHub Desktop.
[color]
ui = auto
branch = auto
diff = auto
status = auto
[core]
excludesfile = ~/.gitignore
whitespace = trailing-space,space-before-tab,cr-at-eol
abbrev = 10
[merge]
tool = vimdiff
log = true
stat = true
[alias]
authors = "!git log --format=format:%an | sort -u"
graphviz = "!f() { echo 'digraph git {' ;\
git log --pretty='format: %h -> { %p }' \"$@\" |\
sed 's/[0-9a-f][0-9a-f]*/\"&\"/g' ; echo '}'; }; f"
co = checkout
cp = cherry-pick
ru = "!echo \"don't use 'git ru', use 'git fa' instead. ;)\""
fa = fetch --all --tags --prune
sub = submodule
commit = commit -v
merged = "!f(){ merged=$(git branch --merged | grep -v -e '^*' -e master | xargs) ; echo $merged ; } ; f"
prune-dev-local = "!f() { git branch -d $( git merged ) ; } ; f"
prune-dev-remote = "!f() { git push ${1:-esc} --delete $( git merged ) ; } ; f"
prune-origin = "remote prune origin"
ls-remote-tags = "!f(){ git ls-remote -t $1 |\
sed 's,^.*refs/tags/,,;s/\\^.*$//' | uniq ; } ; f"
tbrs = "!f() { git branch -r | grep --color=none \"$1\"; }; f"
ls-rt = "!f() { git for-each-ref refs/remotes/\"$1\" --format='%(refname)' | while read line ; do echo ${line#refs/remotes/}; done ; } ; f"
tree = log --oneline --graph --decorate -33
add-root = "!f(){ git symbolic-ref HEAD refs/heads/\"$1\" ;\
rm .git/index ; git clean -fdx;\
echo 'Ready to create new root commit on branch.\
Stage files now to continue' ; }; f"
fft = "tracking fast-forward"
fixup = "commit --amend -C HEAD"
ft = "!echo \"don't use 'git ft', use 'git fu' instead. ;)\""
fu = merge --ff @{u}
wdiff = diff --color-words
gconfig = config --global
rbiau = rebase --interactive @{upstream}
who-signed = "!f(){ git log -- $1 | \
grep Signed-off-by | sort | uniq --count | \
sort --human-numeric-sort --reverse |\
sed 's/Signed-off-by: / /' | head ; } ; f "
ammend = commit --amend
reword = !git stash && git ammend && git stash pop
conf-edit = config --global --edit
cim = commit -m
k = !gitk
demo = "!f(){ echo $2 $1 ; }; f"
wlog = log -1 -p --color-words
fb-clean = "!git for-each-ref --format=\"%(refname)\" refs/original |\
while read ref ; do echo -n \"Deleting: '${ref#refs/}' \
(was:$( git rev-parse --short $ref ))... \"; \
git update-ref -d $ref ; echo done. ; done;"
bp = big-picture
tdiff = difftool --extcmd=mylatexdiff
alias = "!f(){ name=$1 ; shift ; git config --global alias.$name \"!$*\" ; }; f"
checkout-previous = "!git checkout $( git reflog | grep \"checkout: moving\"| head -1 | sed \"s/^.*from\\s\\(.*\\)\\sto\\s\\(.*\\)/\\1/\" )"
cop = "!git checkout-previous"
bpv = "!git big-picture -v firefox"
bpf = "!git big-picture -o /tmp/view.svg ; firefox /tmp/view.svg"
bpo = "!git big-picture -o /tmp/view.svg"
cop = checkout-previous
reset-upstream = reset --hard @{u}
sl = shortlog
slsn = shortlog -sn
mnff = merge --no-ff
show-ignored = ls-files -i --others --exclude-standard
tgz = "!bn=$(basename $(pwd)) && git archive --format=tar --prefix=$bn/ HEAD | gzip -c > $bn-$(git describe --tags --always).tgz"
set-svn-upstream = branch master --set-upstream git-svn
fp = format-patch -1
desc = describe --always --tags --dirty
current-branch = "!full=$(git symbolic-ref HEAD) && echo ${full#refs/heads/}"
current-branch-verbose = "!current=$(git current-branch) && echo \"$(echo -n $current) \\\"$(git log --oneline -1 $current)\\\" ahead: $(git ahead), behind: $(git behind)\""
hub = "!hub"
lg = log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit
stale-local = "!git for-each-ref 'refs/heads' --format='%(refname:short)' | while read line ; do git rev-parse \"$line@{u}\" > /dev/null 2>&1 || echo $line ; done ; "
prune-stale-local = "!git stale-local | xargs git branch -D"
ahead = "!git rev-list @{u}.. | wc -l"
behind = "!git rev-list ..@{u} | wc -l"
[color "status"]
header = 229
untracked = 63
changed = 131
added = 71
nobranch = 124
[color "interactive"]
header = 229
prompt = 25
help = 229
error = 124
[color "diff"]
new = 71
old = 124
whitespace = 124
meta = 131
plain = 247
commit = 229
frag = 37
[color "grep"]
filename = 135 bold
separator = 37
selected = 247
match = 124 bold
linenumber = 71
function = 131
context = 247
[color "branch"]
current = 71
local = 229
plain = 215
remote = 124
[push]
default = tracking
[diff]
mnemonicprefix = true
renames = copies
[interactive]
singlekey = true
[rerere]
enabled = true
[help]
autocorrect = 0
[tig]
line-graphics = "utf8"
show-rev-graph = true
line-graphics = true
show-date = "short"
show-refs = true
show-id = true
show-author = "abbreviated"
author-width = 7
id-width = 7
split-view-height = 80%
read-git-colors = true
[tig "color"]
default = color229 black
cursor = color229 color61 bold
status = color39 default
title-focus = color247 color235 bold
title-blur = color247 color235 bold
date = color25 default
author = color35 default
mode = color39 default
id = color135 default bold
main-revgraph = color53 default
main-head = color207 default bold
main-remote = color207 default
main-tracked = color207 default
main-tag = color203 default bold
main-local-tag = color203 default
main-ref = color135 default
tree-dir = color25 default bold
commit = color71 default
graph-commit = color25 default
palette-0 = color207 default bold
palette-1 = color227 default bold
palette-2 = color39 default bold
palette-3 = color71 default bold
palette-4 = default default bold
palette-5 = color229 default bold
palette-6 = color124 default bold
[advice]
statusHints = false
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment