Created
July 3, 2014 17:29
-
-
Save dadreggors/7097da2653e901371a19 to your computer and use it in GitHub Desktop.
Helpful git alias
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[alias] | |
a = add | |
ap = add -p | |
b = branch | |
bb = "!git for-each-ref --sort='-authordate' --format='%(authordate)%09%(objectname:short)%09%(refname)' refs/heads | sed -e 's-refs/heads/--'" | |
c = commit | |
cam = commit -a -m | |
cav = commit -a --verbose | |
cm = commit -m | |
co = checkout | |
cob = checkout -b | |
copr = "!f() { git fetch -fu origin refs/pull/$1/head:pr-$1; git checkout pr-$1; } ; f" | |
cv = commit --verbose | |
d = diff | |
dc = diff --cached | |
ds = diff --stat | |
dt = difftool | |
l = log --pretty=format:"%C(yellow)%h\\ %ad%Cred%d\\ %Creset%s%Cblue\\ [%cn]" --decorate --date=short | |
la = "!git config -l | grep alias | cut -c 7-" | |
ll = log --pretty=oneline --abbrev-commit --graph --decorate | |
m = merge | |
mt = mergetool | |
prunepr = "!git for-each-ref refs/heads/pr-* --format='%(refname:short)' | while read ref ; do git branch -D $ref ; done" | |
s = status | |
ss = status -s |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The .gitconfig file is your global config located in your home directory (usually "~/.gitconfig" in Unix or Linux).