Skip to content

Instantly share code, notes, and snippets.

@DirkyJerky
Created April 13, 2015 01:06
Show Gist options
  • Save DirkyJerky/c97265d04fdc864e4bfa to your computer and use it in GitHub Desktop.
Save DirkyJerky/c97265d04fdc864e4bfa to your computer and use it in GitHub Desktop.
[core]
pager = less -x4
excludesfile = $HOME/.gitignore_global
editor = /usr/bin/vim
[help]
autocorrect = 1
[color]
branch = auto
diff = auto
status = auto
[color "branch"]
current = red reverse
local = blue
remote = green
[color "diff"]
meta = yellow bold
frag = magenta bold
old = red bold
new = green bold
[color "status"]
added = yellow
changed = green
untracked = cyan
[push]
default = upstream
[pull]
default = current
[diff]
memonicprefix = true
[branch]
autosetuprebase = always
[apply]
whitespace = nowarn
[alias]
ai = add --interactive
alias = "!sh -c '[ $# = 2 ] && git config --global alias.\"$1\" \"$2\" && exit 0 || echo \"usage: git alias <new alias> <original command>\" >&2 && exit 1' -"
aliases = !git config --get-regexp 'alias.*' | colrm 1 6 | sed 's/[ ]/ = /'
amend = commit --amend
assume = update-index --assume-unchanged
assumeall = "!git st -s | awk {'print $2'} | xargs git assume"
assumed = "!git ls-files -v | grep ^h | cut -c 3-"
br = branch
bra = branch -ra
branch = branch -ra
ca = commit --amend
caa = commit -a --amend -C HEAD
ci = commit
cl = clone
cm = commit -m
cma = commit -a -m
co = checkout
cob = checkout -b
cp = cherry-pick
d = diff --word-diff
dc = diff --cached
diff = diff --word-diff
diffr = "!f() { git diff "$1"^.."$1"; }; f"
dl = "!git ll -1"
dlc = diff --cached HEAD^
done = !git fetch && git rebase origin/master && git checkout master && git merge @{-1} && git push
#done = "!f() { git branch | grep "$1" | cut -c 3- | grep -v done | xargs -I{} git branch -m {} done-{}; }; f"
dr = "!f() { git diff -w "$1"^.."$1"; }; f"
empty = "!git commit -am\"[empty] Initial commit\" --allow-empty"
f = "!git ls-files | grep -i"
filelog = log -u
fl = log -u
gr = grep -Ii
gra = "!f() { A=$(pwd) && TOPLEVEL=$(git rev-parse --show-toplevel) && cd $TOPLEVEL && git grep --full-name -In $1 | xargs -I{} echo $TOPLEVEL/{} && cd $A; }; f"
grep = grep -Ii
hub = !sh ~/bin/git/hub.sh
k = !gitk
lap = "!f() { git --git-dir=$1 format-patch -k -1 --stdout $2 | git am -3 -k; }; f"
lasttag = describe --tags --abbrev=0
lc = "!f() { git ll "$1"^.."$1"; }; f"
lds = log --pretty=format:"%C(yellow)%h\\ %C(green)%ad%Cred%d\\ %Creset%s%Cblue\\ [%cn]" --decorate --date=short --graph
le = log --oneline --decorate
ll = log --pretty=format:"%C(yellow)%h%Cred%d\\ %Creset%s%Cblue\\ [%cn]" --decorate --numstat
lnc = log --pretty=format:"%h\\ %s\\ [%cn]"
ls = log --pretty=format:"%C(green)%h\\ %C(yellow)[%ad]%Cred%d\\ %Creset%s%Cblue\\ [%cn]" --decorate --date=relative
ls1 = log --pretty=format:"%C(yellow)%h%Cred%d\\ %Creset%s%Cblue\\ [%cn]" --decorate
lt = describe --tags --abbrev=0
lucky = log --oneline
new = !sh -c 'git log $1@{1}..$1@{0} "$@"'
octc = "!sh -c 'git hub OvercastNetwork $1' -"
ours = "!f() { git co --ours $@ && git add $@; }; f"
pullhub = "!sh -c 'cd ~/git/$1/$2 && git pull' -"
pullme = "!sh -c 'cd ~/git/DirkyJerky/$1 && git pull' -"
r = reset
r1 = reset HEAD^
r2 = reset HEAD^^
rem="!git config -l | grep remote.*url | tail -n +2"
rh = reset --hard
rh1 = reset HEAD^ --hard
rh2 = reset HEAD^^ --hard
sa = stash apply
sba = "!f() { git subtree add --prefix $2 $1 master --squash; }; f"
sl = stash list
ss = stash save
st = status -s
svnd = svn dcommit
svnl = svn log --oneline --show-commit
svnr = svn rebase
theirs = "!f() { git co --theirs $@ && git add $@; }; f"
unassume = update-index --no-assume-unchanged
unassumeall = "!git assumed | xargs git update-index --no-assume-unchanged"
who = shortlog -s --
rs1 = reset HEAD^ --soft
rs2 = reset HEAD^^ --soft
rf = "reset HEAD "
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment