Skip to content

Instantly share code, notes, and snippets.

@cohen990
Created June 20, 2015 19:07
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 cohen990/ca4fbbc99ab6773f450d to your computer and use it in GitHub Desktop.
Save cohen990/ca4fbbc99ab6773f450d to your computer and use it in GitHub Desktop.
Pi gitconfig
[user]
name = Dan Cohen
email = dancohen447@gmail.com
[color "branch"]
upstream = bold magenta
[alias]
s = status
b = branch
pu = pull upstream
pl = pull --rebase
rum = remote update
p = push
c = !git add -A && git commit
cm = !git add -A && git commit -m
g = !git gui &
co = checkout
ecg = !git config --global -e
ec = config -e
cob = checkout -b
save = !git add -A && git commit -m 'SAVEPOINT'
undo = reset HEAD~1 --mixed
amend = !git add -A && git 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"
l = "!f() { git --no-pager log -${1-5}; }; f"
r = rebase
pseto = "!f() { git rev-parse --abbrev-ref HEAD | xargs -r git push --set-upstream origin; }; f"
lol = "!f() { git --no-pager log --pretty=tformat:'%Cred%h%Creset %Cgreen(%cr)%Creset %s %C(bold blue)<%an>%Creset' --abbrev-commit --date=relative --graph -${1-10}; }; f"
mpr = "!f() { git checkout ${2-master} && git remote update && git pull upstream ${2-master} && git fetch upstream pull/$1/head:pr-$1 && git merge --no-ff --no-commit pr-$1 && git branch -D pr-$1; }; f"
[gc]
auto = 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment