Skip to content

Instantly share code, notes, and snippets.

@macournoyer
Last active September 30, 2015 23:18
Show Gist options
  • Save macournoyer/1878273 to your computer and use it in GitHub Desktop.
Save macournoyer/1878273 to your computer and use it in GitHub Desktop.
Git shortcuts
[alias]
st = status
s = status
co = checkout
c = commit -v
ci = commit -a -v
b = branch
d = diff
p = pull
a = add -A .
l = log
cip = !git a && git ci && git push
pushed = !git cherry -v `git symbolic-ref HEAD 2> /dev/null`
klog = log --graph --pretty=format:'%an: %s - %Cred%h%Creset %C(yellow)%d%Creset %Cgreen(%cr)%Creset' --abbrev-commit --date=relative
stls = ls-files
edit-unmerged = "!f() { git ls-files --unmerged | cut -f2 | sort -u ; }; mate `f`"
add-unmerged = "!f() { git ls-files --unmerged | cut -f2 | sort -u ; }; git add `f`"
lc = log ORIG_HEAD.. --stat --no-merges
who = log --pretty='format:%Cgreen%an%Creset\t%C(yellow)%ar%Creset\t%s ' --no-merges
unstage = reset HEAD
@lolmaus
Copy link

lolmaus commented Sep 28, 2014

Hey Marc, i've noticed an inconsitency: ci only commits changes in tracked files, while cip adds all untracked files.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment