Skip to content

Instantly share code, notes, and snippets.

@ryanve
Last active May 11, 2022 09:17
Show Gist options
  • Save ryanve/06fd45e2b65852003db6 to your computer and use it in GitHub Desktop.
Save ryanve/06fd45e2b65852003db6 to your computer and use it in GitHub Desktop.
git aliases
[alias]
co = checkout
ci = commit
ca = commit --amend
cia = commit -a
can = commit --amend --no-edit
com = checkout master
st = status
s = status --short
b = branch
ba = branch -a
br = branch
current = rev-parse --abbrev-ref HEAD
hist = log --pretty=format:\"%h %ad | %s%d [%an]\" --graph --date=short
day = log --pretty=format:'%Cred%h%Creset %an: %s - %Creset %C(yellow)%d%Creset %Cgreen(%cr)%Creset' --abbrev-commit --date=relative --since="24.hours"
hard = reset --hard origin/master
home = !"git com && git fop && git hard && git st"
pages = checkout gh-pages
pages-hard = reset --hard origin/gh-pages
pages-home = !"git pages && git fop && git pages-hard && git st"
fresh = !"git home && git co -b"
waste = !"git home && git bleach"
uncommit = reset --hard @{u}
recommit = commit --amend --no-edit
rebuild = commit --allow-empty -m ''
redo = rebase -i head~1
redq = rebase -i head~9
repush = !"git recommit && git push"
type = cat-file -t
dump = cat-file -p
d = diff
di = diff
df = diff
dc = diff --cached
conflicts = diff --name-only --diff-filter=U
lg = log -p
lol = log --graph --decorate --pretty=oneline --abbrev-commit
lola = log --graph --decorate --pretty=oneline --abbrev-commit --all
ll = log --pretty=format:'%C(yellow)%h%Creset %C(green)%cd%Creset%x09%C(yellow)%d%Creset %s [%C(red)%an%Creset]' --graph --date=relative --decorate
ls = ls-files
ign = ls-files -o -i --exclude-standard
sf = show --decorate --pretty=short --name-only
ss = show --stat
sc = log --max-count=1 --pretty=fuller --decorate
puhs = push
pus = push
pu = push
pt = !"git push --tags"
pp = !"git pu && git pt"
p = pull
pul = pull
pr = pull --rebase
fo = fetch origin
fp = fetch --prune
fop = fetch origin --prune
merge-theirs = merge -s recursive -X theirs --no-ff
ls-subtrees = !"git log | grep git-subtree-dir | awk '{ print $2 }'"
mop = !"git com && git branch --merged master | grep -v '\\* master' | xargs -n 1 git branch -d"
bleach = !"git branch | grep --invert-match "master" | xargs git branch -D"
rpo = remote prune origin
mm = merge master --no-edit
@ryanve
Copy link
Author

ryanve commented Feb 23, 2015

Includes aliases from jrabbe/environment-settings and more

@ryanve
Copy link
Author

ryanve commented Oct 29, 2021

aliases @jrdnrch

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