Skip to content

Instantly share code, notes, and snippets.

@sbpipb
Last active December 4, 2019 07:40
Show Gist options
  • Save sbpipb/235a4285910eeac7b32974a636639564 to your computer and use it in GitHub Desktop.
Save sbpipb/235a4285910eeac7b32974a636639564 to your computer and use it in GitHub Desktop.
GITHUB

Shows git commits on all your local branches, sorted oldest to newest

git for-each-ref --sort=committerdate refs/remotes/ --format='%(HEAD) %(color:yellow)%(refname:short)%(color:reset) - %(color:red)%(objectname:short)%(color:reset) - %(contents:subject) - %(authorname) (%(color:green)%(committerdate:relative)%(color:reset))'

removing changes from a branch

Git Rebase Onto

git rebase --onto branch_1 old_branch branch_2

https://medium.com/@gabriellamedas/git-rebase-and-git-rebase-onto-a6a3f83f9cce

This article also is a primer on rebase in general

git rebase master feature_branch

is the same as

git checkout feature_branch
git rebase master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment