Skip to content

Instantly share code, notes, and snippets.

@justsml
Last active February 22, 2016 21:08
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 justsml/6eca3dc5d0fed175b014 to your computer and use it in GitHub Desktop.
Save justsml/6eca3dc5d0fed175b014 to your computer and use it in GitHub Desktop.
.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