Skip to content

Instantly share code, notes, and snippets.

@acook
Created December 3, 2012 23:49
Show Gist options
  • Save acook/4199144 to your computer and use it in GitHub Desktop.
Save acook/4199144 to your computer and use it in GitHub Desktop.
Git aliases
co = checkout
st = status
ci = commit
w = whatchanged
nb = checkout -b
b = branch
amend = commit --amend
unstash = stash pop
unstage = reset HEAD --
remotes = remote -v
root = rev-parse --show-toplevel
origin = remote show origin
diffs = diff --staged
diffh = diff HEAD
last = log -1 HEAD
unmerged = ls-files --unmerged
lg = !GIT_PAGER=less git log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --date=relative
lp = !GIT_PAGER=less git log -p --patience
l = !GIT_PAGER=less git log --pretty=oneline --abbrev-commit --decorate
subdo = submodule foreach git
top = !eval cd "$(pwd)/$(git rev-parse --show-cdup)" && pwd
dog = log --decorate --oneline --graph
ls = !git ls-tree HEAD --name-only | fmt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment