In this article we’ll be discussing git merge and git rebasecommands and when we should use them.

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.

             ---- c5 ---- c6 ---- c7 (feature)
c1 ---- c2 ------ c3 ---- c4 (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 of both branches.

#programming #software-development #git #git-merge #git-rebase

Do You Know the Difference Between Git Merge and Git Rebase
2.15 GEEK