Skip to content

Instantly share code, notes, and snippets.

@archer884
Forked from dahlbyk/Git Aliases
Created March 1, 2019 20:12
Show Gist options
  • Save archer884/912e27fa8b59df656ad6962e052a3a51 to your computer and use it in GitHub Desktop.
Save archer884/912e27fa8b59df656ad6962e052a3a51 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