Skip to content

Instantly share code, notes, and snippets.

@rosscdh
Created June 21, 2018 15:09
Show Gist options
  • Select an option

  • Save rosscdh/1851b534f5cf1048a313f88b053872bf to your computer and use it in GitHub Desktop.

Select an option

Save rosscdh/1851b534f5cf1048a313f88b053872bf to your computer and use it in GitHub Desktop.
[alias]
addremove = !git r && git add . --all
aliases = !git config --list | grep 'alias\\.' | sed 's/alias\\.\\([^=]*\\)=\\(.*\\)/\\1\\ \t => \\2/' | sort
all = add . --all
amend = !git log -n 1 --pretty=tformat:%s%n%n%b | git commit -F - --amend
br = branch -av
brname = !git branch | grep "^*" | awk '{ print $2 }'
brdel = branch -D
ci = commit
changes = "!f() { git log --pretty=format:'* %s' $1..$2; }; f"
churn = !git log --all -M -C --name-only --format='format:' "$@" | sort | grep -v '^$' | uniq -c | sort | awk 'BEGIN {print "count,file"} {print $1 "," $2}'
co = checkout
details = log -n1 -p --format=fuller
export = archive -o latest.tar.gz -9 --prefix=latest/
unstage = reset HEAD --
g = !git log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --date=relative
in = pull --dry-run
l = "!f() { git log $* | grep '^commit ' | cut -f 2 -d ' '; }; f"
out = log --branches --not --remotes
r = !git ls-files -z --deleted | xargs -0 git rm
root = rev-parse --show-toplevel
st = status
subup = submodule update --init
tags = tag -l
this = !git init && git add . && git commit -m \"Initial commit.\"
trim = !git reflog expire --expire=now --all && git gc --prune=now
squash = "!f(){ git reset --soft HEAD~${1} && git commit --edit -m\"$(git log --format=%B --reverse HEAD..HEAD@{1})\"; };f"
[credential]
helper = osxkeychain
[color]
ui = true
[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 = red
[core]
autocrlf = input
compression = 9
excludesfile = /Users/r.crawforddheureuse/.gitignore_global
filemode = false
[diff]
mnemonicprefix = true
[merge]
log = true
ff = false
[push]
default = simple
[url "https://bitbucket.org/"]
insteadOf = bb:
[url "https://github.com/"]
insteadOf = gh:
[url "https://gist.github.com/"]
insteadOf = gist:
[user]
name = Ross Crawford-d'Heureuse
email = r.crawford@example.com
[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
[commit]
template = /Users/r.crawforddheureuse/.stCommitMsg
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment