Git workflows cheatsheet

Workflows

Rebase a branch that was made off a feature branch

You started a feature and opened a PR. You started to work on your next feature off of your last branch. After you PR is merged in you want to rebase back onto develop with your changes.

From this…

git-feat-off-feat

To this…

git-feat-rebased

Get the commit hash where you started your branch

gfo  # Fetch origin
glog | yank  # look at graph and copy commit hash

Rebase from that commit to your current commit on top of origin/develop

git rebase -i {paste_commit_hash} --onto origin/develop

Git Aliases

Git Alias Full command
gfo git fetch origin
glog git log --oneline --decorate --graph