Skip to content

Instantly share code, notes, and snippets.

@mattkasa
Created January 23, 2013 19:27
Show Gist options
  • Save mattkasa/4611908 to your computer and use it in GitHub Desktop.
Save mattkasa/4611908 to your computer and use it in GitHub Desktop.
GIT Aliases: git st/git stat (git status), git ci (check-in or git commit), git co (git checkout), git br (git branch), git ls (git ls-files), git undo (undo last unpushed commit), git cdiff (commit diff, diff of unpushed commits), git ldiff (last diff, diff of last two HEAD refs, eg. use after a pull to see what was pulled), git pstat and git p…
[alias]
st = status
stat = status
ci = commit
co = checkout
br = branch
ls = ls-files
undo = reset --soft HEAD^
merge = merge --no-commit
cdiff = diff --cached
ldiff = diff HEAD@{1}..HEAD@{0}
pstat = !GIT_CURRENT_BRANCH=$(git name-rev --name-only HEAD) && git --no-pager log --name-status origin/$GIT_CURRENT_BRANCH..$GIT_CURRENT_BRANCH
pdiff = !GIT_CURRENT_BRANCH=$(git name-rev --name-only HEAD) && git log -p origin/$GIT_CURRENT_BRANCH..$GIT_CURRENT_BRANCH
abandon = "!GIT_ABANDON() { git checkout -- $(git status | sed -ne \"/^#[[:space:]]\\+\\(deleted\\|modified\\):/{s/^#[[:space:]]\\+[^:]\\+:[[:space:]]\\+\\(.*\\)$/\\1/;p}\"); }; GIT_ABANDON"
lrev = log --reverse --no-merges --stat @{1}..
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment