Skip to content

Instantly share code, notes, and snippets.

@justsml

justsml/.gitconfig

Last active Feb 22, 2016
Embed
What would you like to do?
.gitconfig
[core]
autocrlf = false
[push]
default = upstream
[i18n]
filesEncoding = utf-8
[color]
branch = auto
diff = auto
status = auto
[color "branch"]
current = yellow reverse
local = yellow
remote = green
[color "diff"]
meta = yellow bold
frag = magenta bold
old = red bold
new = green bold
[color "status"]
added = yellow
changed = green
untracked = cyan
[alias]
merge = fetch --no-ff
mreview = fetch --no-ff --no-commit # preview merge without actually commiting any file cahnges
st = status
diff = diff -b
cm = commit -am # Append comment, e.g: git cm "New code"
br = branch -v # List branches
remotes = remote -v # List remotes
co = checkout
nb = checkout -b
c = missing master
m = missing
del = obliterate
df = diff
lg = log -p
who = shortlog -s --
lc = log ORIG_HEAD.. --stat --no-merges
llog = log --date=local
recent = diff HEAD..HEAD^ --name-status
konflict = !gitk --left-right HEAD...MERGE_HEAD
edit-unmerged = "!f() { git ls-files --unmerged | cut -f2 | sort -u ; }; vim `f`"
add-unmerged = "!f() { git ls-files --unmerged | cut -f2 | sort -u ; }; git add `f`"
k = !gitk
cleanse = clean -d -f
pa = add -p # Interactivly Add Files Selectively
join = merge --no-ff
up = !sh -c 'git pull --rebase --prune && git log --pretty=format:\"%Cred%ae %Creset- %C(yellow)%s %Creset(%ar)\" HEAD@{1}..'
removed = !sh -c 'git log -1 -p | grep "^- " | wc -l'
added = !sh -c 'git log -1 -p | grep "^+ " | wc -l'
recommit = commit --amend # Amend prev commit with latest changes
undo = reset --soft HEAD~1
ribbon = tag --force _ribbon origin/master
catchup = log --patch --reverse --topo-order _ribbon..origin/master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.