Skip to content

Instantly share code, notes, and snippets.

@iambacon
Last active November 29, 2016 10:44
Show Gist options
  • Save iambacon/d648a46a4d2d2a9e67fb to your computer and use it in GitHub Desktop.
Save iambacon/d648a46a4d2d2a9e67fb to your computer and use it in GitHub Desktop.
Git alias and colour config with SourceGear DiffMerge settings
[diff]
tool = DiffMerge
[difftool "DiffMerge"]
cmd = 'C:/Program Files/SourceGear/Common/DiffMerge/sgdm.exe' "$LOCAL" "$REMOTE"
[merge]
tool = DiffMerge
[mergetool "DiffMerge"]
cmd = 'C:/Program Files/SourceGear/Common/DiffMerge/sgdm.exe' -merge -result="$PWD/$MERGED" "$PWD/$LOCAL" "$PWD/$BASE" "$PWD/$REMOTE"
trustExitCode = true
[mergetool]
keepBackup = false
[color "branch"]
upstream = bold magenta
[alias]
rml = ! git branch --merged | grep -v \\* | xargs git branch -d
compr = ! git count-objects && git gc --aggressive && git count-objects
sync = "!f() { git checkout ${1-master} && git pull --ff-only upstream ${1-master} && git push; }; f"
co = checkout
ec = config --global -e
up = !git pull --rebase --prune $@ && git submodule update --init --recursive
cob = checkout -b
cm = !git add -A && git commit -m
save = !git add -A && git commit -m 'SAVEPOINT'
wip = !git add -u && git commit -m "WIP"
undo = reset HEAD~1 --mixed
amend = commit -a --amend
wipe = !git add -A && git commit -qm 'WIPE SAVEPOINT' && git reset HEAD~1 --hard
bclean = "!f() { git branch --merged ${1-master} | grep -v " ${1-master}$" | xargs -r git branch -d; }; f"
bdone = "!f() { git checkout ${1-master} && git up && git bclean ${1-master}; }; f"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment