Skip to content

Instantly share code, notes, and snippets.

@dahlbyk
Created June 13, 2016 14:09
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save dahlbyk/cb062ca2823cce8c4122ce482f6f2678 to your computer and use it in GitHub Desktop.
Save dahlbyk/cb062ca2823cce8c4122ce482f6f2678 to your computer and use it in GitHub Desktop.
[alias]
co = checkout
# New branch
nb = checkout origin -b
# Push new branch
pnb = push -u origin HEAD
# Log Graph
lg = log --oneline --decorate --graph
# Log (Graph) All
la = log --oneline --decorate --graph --all
# New Since master
new = log --oneline --decorate --reverse origin..
# Update from origin; keep master in sync; rebase on latest
up = !git fetch --all --prune && git rebase origin && git push . origin/HEAD:master 2>/dev/null
# Update from origin; keep master in sync; don't rebase on latest
upish = !git fetch --all --prune && git push . origin/HEAD:master 2>/dev/null
# Reset to upstream (e.g. someone force-pushed)
rup = reset @{u}
# Diff what's in index
di = diff --staged
ci = commit
cia = commit --amend -C HEAD
ciar = commit --amend -C HEAD --reset-author
rbi = rebase --interactive
rbc = rebase --continue
rbe = rebase --edit-todo
rba = rebase --abort
# Rewrite in-place (rather than rebase on latest)
rwi = !git rebase --interactive $(git merge-base origin HEAD)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment