Member-only story

Git Concepts and Commands

Do You Know the Difference Between Git Merge and Git Rebase?

Know the differences between git rebase and git merge and their workflow.

Vikram Gupta
4 min readOct 24, 2024

--

Merge Vs Rebase

A lot of software developers and programmers get confused with git merge and git rebase . So I thought of clearing this doubt thru the medium of this article. We’ll see their differences and when to use them.

What Is Git Merge and Git Rebase?

git rebasedoes the same job as a git mergethat is merging the changes from one branch to another branch. The difference is that they do it very differently.

Consider you are working on one of the features of an application in the featurebranch and the git commit history has the following structure.

before git merge master

How to Merge the Master Branch to the Feature Branch Using git merge?

  1. git checkout feature
  2. git merge master

The above merge process will create a new merge commit in the feature branch which will have a history…

--

--

Vikram Gupta
Vikram Gupta

Written by Vikram Gupta

-: Empowering Developers to Ace Their Technical Interviews :- A Senior Engineer building Scalable, Reliable, and Containerized Cloud Applications. 5M+ views.

No responses yet

Write a response