What is the difference between rebasing and merge in git?
Answer / Amit Kumar Batar
Rebasing and merging are two common methods for integrating changes from one branch to another in Git. Here's a summary of their differences:n1. Rebase: When you rebase, you move or combine a feature branch onto another branch. This results in a linear history where the features are built on top of the latest version of the target branch, rather than having multiple independent lines of development. However, rebasing can be confusing if others are also working on the same branches as it will appear as though commits are being rewritten.n2. Merge: When you merge, you combine changes from another branch into your current branch. This creates a new commit that represents the merge point between the two branches. The original commits remain intact, and there's no linearization of the history like with rebasing. Merging is typically less disruptive to others working on the same project because it doesn't change the commit history.
| Is This Answer Correct ? | 0 Yes | 0 No |
What is the function of ‘git reset’?
In git, how would you return a commit that has just been pushed and made open?
What is git and why do we use it?
What is a repository and how will you create it?
How do you configure a git repository to run code sanity checking tools right before making commits, and preventing them if the test fails?
What is git fork? What is the difference between fork, branch, and clone?
What does ‘hooks’ comprise of in git?
What is ‘head’ in git?
What is the command you can use to write a commit message?
What is the function of ‘git stash apply’?
What is the syntax for “Rebasing” in Git?
What is a git commit and what does the commit object contain?