You are developing an application whose source repository has multiple branches. You have made several changes to a branch that is used for experimentation. You need to update the main branch so that it captures the changes made on the experimentation branch, while also overriding the history of the Git repository. Which Git option should you use?
Git rebase moves or replays the commits from one branch onto another, creating brand-new commits with new hashes for each original commit. This process rewrites the commit history, producing a linear sequence rather than preserving the original branching structure, which is what "overriding the history" refers to. Merge, by contrast, preserves the original history of both branches and adds a merge commit rather than rewriting it. Fetch only retrieves updates from a remote without integrating them, and Push only uploads local commits to a remote repository — neither operation integrates changes from another branch while rewriting history the way rebase does.