What is the key difference between a ‘git rebase’ and ‘git merge’

Devops Devops in Devops . 3 years ago

  2   0   0   0   0 tuteeHUB earn credit +10 pts

5 Star Rating 1 Rating
  • ‘git MERGE’ takes the unique commits from the two BRANCHES, merge them together and CREATE another commit with the merged changes; whereas in a ‘git rebase’ the work on the current branch is replayed and placed at the tip of the other branch resulting in re-writing the commit objects.
  • ‘git rebase’ is applied from the branch to be rebased, whereas ‘git merge’ is applied on the branch that needs to merge the feature branch.
  • ‘git merge’ preserves the history and makes it easier to track the ownership or when a code was broken in the project history; UNLIKE ‘git rebase’ which changes the commit history by changing the commit objects (SHA-1) ids.
  • ‘git rebase’ is often used locally for feature and quickfix and bug fix branches; however ‘git merge’ are used for long running STABLE branches.

Posted on 31 May 2022, this text provides information on Devops related to Devops in Devops. Please note that while accuracy is prioritized, the data presented might not be entirely correct or up-to-date. This information is offered for general knowledge and informational purposes only, and should not be considered as a substitute for professional advice.

Take Quiz To Earn Credits!

Turn Your Knowledge into Earnings.

tuteehub_quiz

Tuteehub forum answer Answers

Post Answer

No matter what stage you're at in your education or career, TuteeHub will help you reach the next level that you're aiming for. Simply,Choose a subject/topic and get started in self-paced practice sessions to improve your knowledge and scores.