Skip to content

Instantly share code, notes, and snippets.

@ryanirelan
Created April 20, 2016 19:20
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 ryanirelan/d9ea70131e5f4f544858356b3e7ac58c to your computer and use it in GitHub Desktop.
Save ryanirelan/d9ea70131e5f4f544858356b3e7ac58c to your computer and use it in GitHub Desktop.
git-alias
[alias]
zip = archive --format=zip -o latest.zip HEAD
yesterday = log --before={`date \"+%Y-%m-01\"`} --after={`date -v-1m \"+%Y-%m-01\"`}
st = status
b = branch
p = pull
lg = log
type = cat-file
r = remote
unstage = reset
alist = "!alistalias() { git config --global --get-regexp alias | awk -v nr=2 '{sub(/^alias\\./,\"\")}; {printf \"\\033[31m%_10s\\033[1;37m\", $1}; {sep=FS};{for (x=nr; x<=NF; x++) {printf \"%s%s\", sep, $x; }; print \"\\033[0;39m\"}'; }; alistalias"
finda = "!grepalias() { git config --global --get-regexp alias | grep -i \"$1\" | awk -v nr=2 '{sub(/^alias\\./,\"\")};{printf \"\\033[31m%_10s\\033[1;37m\", $1};{sep=FS};{for (x=nr; x<=NF; x++) {printf \"%s%s\", sep, $x; }; print \"\\033[0;39m\"}'; }; grepalias"
rh = reset HEAD
c = commit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment