A team notices that their feature branch is several commits behind the main branch. What Git strategy should they employ to update their branch without cluttering the commit history?

  • Merge the main branch into the feature branch
  • Rebase the feature branch onto the main branch
  • Cherry-pick the changes from the main branch and apply to the feature branch
  • Create a new branch from the main branch and merge it into the feature branch
To update a feature branch without cluttering the commit history, it's advisable to use rebase. This integrates the latest changes from the main branch into the feature branch, maintaining a linear history and avoiding unnecessary merge commits.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *