Skip to content

Instantly share code, notes, and snippets.

@sptq
Last active August 29, 2015 14:02
Show Gist options
  • Save sptq/8dcf38bace78cb982da0 to your computer and use it in GitHub Desktop.
Save sptq/8dcf38bace78cb982da0 to your computer and use it in GitHub Desktop.
My git configuration file.
[user]
name = sptq
email = [email protected]
# ===[ALIAS-START]===
#
[alias]
c = checkout
cm = commit -m
sn = snapshot
cb = checkout -b
aa = add --all
s = status -sb
rp = rev-parse --short=4
b = branch
lol = log --graph --pretty=format:'%C(yellow)%h%Creset %an: %s - %Creset %C(yellow)%d%Creset %Cblue(%cr)%Creset' --abbrev-commit --date=relative
lola = log --graph --pretty=format:'%C(yellow)%h%Creset %an: %s - %Creset %C(yellow)%d%Creset %Cblue(%cr)%Creset' --abbrev-commit --date=relative --all
ls = ls-files
l = log --pretty=oneline --abbrev-commit --abbrev=4 -25
g = log --pretty=oneline --abbrev-commit --abbrev=4 -25 --graph
ld = log --pretty=format:"%C(yellow)%h\\ %ad%Cred%d\\ %Creset%s%Cblue\\ [%cn]" --decorate --date=relative
ll = log --pretty=format:"%C(yellow)%h%Cred%d\\ %Creset%s%Cblue\\ [%cn]" --decorate --numstat
bl = branch -r
br = branch -a
# General purpose aliases:
# snapshot
# backup
# Alias: snapshot
# Example:
#
# git snapshot This is my very important commit...
# git snapshot "This is my very important commit..."
#
snapshot = "!snapshot() { git add -A; git commit -m "\"$*\""; }; snapshot"
# Alias: backup
# Example:
#
# git backup This is my very important commit...
# git backup "This is my very important commit..."
#
backup = "!backup() { git snapshot "\"$*\""; git push; }; backup"
#
# ===[ALIAS-STOP]===
[push]
default = matching
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment