Skip to content

Instantly share code, notes, and snippets.

@devth
Created June 27, 2012 16:43
Show Gist options
  • Save devth/3005317 to your computer and use it in GitHub Desktop.
Save devth/3005317 to your computer and use it in GitHub Desktop.
git aliases
[alias]
st = status -sb
ci = commit
co = checkout
br = branch
sb = show-branch
dt = difftool
pu = push
cia = commit -a --amend
r = remote
branch-name = !git for-each-ref --format='%(refname:short)' `git symbolic-ref HEAD`
desc = !git config branch.`git branch-name`.description
# log variations
hist = log --pretty=format:\"%h %Cgreen%ad%Creset %s%d [%an]\" --graph --date=short
hi = !git hist --since=1.week.ago
h = !git hi
week = !git hi
today = !git hist --since=1.day.ago
last = !git --no-pager hi -n1
lol = log --graph --decorate --oneline
lola = log --graph --decorate --oneline --all
tree = log --oneline --decorate --graph
cp = cherry-pick
a = add -A
# since master
sm = log master.. --pretty=oneline --graph --date=short --abbrev-commit
# tags sorted by date
t = for-each-ref --sort='*authordate' --format='%(tag)' refs/tags
# deleted files
deleted = !git hist --diff-filter=D --summary
# git svn
sr = svn rebase
sd = svn dcommit
# logs
h1 = !git hi -1
l1 = log --pretty=oneline
ls = !git hi --stat
lg = log --graph
root = !pwd
tracks = !sh -c 'git rev-parse --verify "${1:-HEAD}@{upstream}" 2> /dev/null'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment