Git rebase re-applies commits from current branch on top of another branch. Thus creates a linear history.
Let’s start with this repository.
Current branch is dev. After running $ git rebase master. The commits are lined up.
Compare to merge, if run $ git merge master. The result will be non-linear.