Fast-forward with Rebase

When we learn git merge, we can fast-forward a left-behind branch by the following steps:

Scenario: Assume we are in development branch, we want to fast-forward the master branch–which is 10 commits behind–into the development branch.

  1. git checkout master
  2. git merge development

By using rebase, we can use 1 step to archive the same effect:

  1. git rebase development master

It means checkout master branch and rebase master onto development.