Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save dmitrylitmanovich/7c836cb9d4ab079aba38772d89984939 to your computer and use it in GitHub Desktop.

Select an option

Save dmitrylitmanovich/7c836cb9d4ab079aba38772d89984939 to your computer and use it in GitHub Desktop.
Git useful aliases (~/.gitconfig)
[alias]
# Basics
st = status -sb
co = checkout
br = branch
cp = cherry-pick
# Logging
lg = log --oneline --graph --decorate --all
ll = log --oneline -20
who = shortlog -sn --no-merges
# Diffing
df = diff
ds = diff --staged
dw = diff --word-diff
# Committing
cm = commit -m
ca = commit --amend --no-edit
fixup = commit --fixup
# Branching
new = checkout -b
gone = branch -vv | grep ': gone]' | awk '{print $1}' | xargs git branch -d
# Stashing
sl = stash list
sp = stash pop
ss = stash save
# Rebasing
ri = rebase -i
rc = rebase --continue
ra = rebase --abort
# Undo
undo = reset HEAD~1 --mixed
nuke = reset HEAD~1 --hard
unstage = restore --staged .
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment