Skip to main content

Shorter Git commands for rebasing / merging / reviewing

· 2 min read

For when you want move your branch's commits to the tip of master.

One-liner

Run this while on your feature branch:

git pull --rebase origin master

Alternate commands

Does the same thing in 2 lines:

git fetch origin master
git rebase origin master

Does the same thing in 4 lines, but it also updates your master branch for the next time you create a new branch

git checkout master
git pull origin master
git checkout -
git rebase master