Skip to content

Instantly share code, notes, and snippets.

@khebbie
Created August 11, 2015 06:59
Show Gist options
  • Save khebbie/c1ccb6e68d3d6f91262a to your computer and use it in GitHub Desktop.
Save khebbie/c1ccb6e68d3d6f91262a to your computer and use it in GitHub Desktop.
New git config with Haackeds aliases
[user]
name = Klaus Hebsgaard
email = [email protected]
[alias]
co = checkout
aa = add --all .
br = branch
ci = commit
fu = reset --hard
# Log display from screencast, with train tracks.
l = log --graph --pretty=format':%C(yellow)%h%Cblue%d%Creset %s %C(white) %an, %ar%Creset'
# Alternate log display from Scott Chacon
lol = log --pretty=oneline --abbrev-commit --graph --decorate
# Other useful aliases:
unstage = reset HEAD
staged = diff --cached
unstaged = diff
current-branch = !git symbolic-ref -q HEAD | sed -e 's|^refs/heads/||'
# Usage: git track origin/feature-123-login-form
track = checkout -t
# http://haacked.com/archive/2014/07/28/github-flow-aliases/
# pull - just a bit more advanced
up = !git pull --rebase --prune $@ && git submodule update --init --recursive
cob = checkout -b
cm = !git add -A && git commit -m
# adds even untracked files
save = !git add -A && git commit -m 'SAVEPOINT'
# addes tracked files
wip = !git add -u && git commit -m "WIP"
# reset last commit but keeps it in the working dir
undo = reset HEAD~1 --mixed
amend = commit -a --amend
# resets last commit but keeps it in the reflog
wipe = !git add -A && git commit -qm 'WIPE SAVEPOINT' && git reset HEAD~1 --hard
# delete merged branches
bclean = "!f() { git branch --merged ${1-master} | grep -v " ${1-master}$" | xargs git branch -d; }; f"
# switch to master, update from github and delete merged branched
bdone = "!f() { git checkout ${1-master} && git up && git bclean ${1-master}; }; f"
[apply]
whitespace = warn
[color]
diff = auto
status = auto
branch = auto
ui = true
[help]
autocorrect = 1
[status]
submodule = 1
[push]
# Only push branches that have been set up to track a remote branch.
default = upstream
[diff]
tool = p4merge
[difftool "p4merge"]
cmd = "p4merge.sh $LOCAL $REMOTE"
[merge]
tool = p4merge
[mergetool "p4merge"]
cmd = "p4merge.sh $BASE $LOCAL $REMOTE $MERGED"
trustExitCode = true
keepBackup = false
[core]
editor = vim
excludesfile = /Users/khebbie/.gitignore_global
[difftool "sourcetree"]
cmd = opendiff \"$LOCAL\" \"$REMOTE\"
path =
[mergetool "sourcetree"]
cmd = /Applications/SourceTree.app/Contents/Resources/opendiff-w.sh \"$LOCAL\" \"$REMOTE\" -ancestor \"$BASE\" -merge \"$MERGED\"
trustExitCode = true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment