Both rebase and merge commands are used to integrate changes from one branch to another but in a different manner.
As seen in the below two images, suppose you have commits (this is before merge/rebase). After the merge, you will get the result as a combination of commits. It binds together the histories of both the branches and creates a new ‘merge commit’ in the feature branch.
On the other hand, rebase will move the whole feature branch to begin at the tip of the master branch.