How do you rebase a branch in Git?
a)
git merge branchb)
git rebase branchc)
git pull branchd)
git sync branchAnswer:
b)
git rebase branchExplanation:
The git rebase branch command is used to apply the commits from one branch on top of another. It rewrites the commit history to make it appear as though the branch was created from the latest commit in the base branch.
For example, git rebase main will reapply your branch’s commits on top of the latest commits in the main branch.
Rebasing is useful for keeping a clean and linear project history, but it should be used carefully, especially on shared branches.