A developer needs to integrate their feature branch with the latest updates from the main branch, but wants to maintain a clean history. Should they use merge or rebase, and why?
- Merge
- Rebase
- Merge and then Rebase
- Rebase and then Merge
When integrating a feature branch with the main branch while maintaining a clean history, rebase is preferred over merge. Rebase allows for a linear and cleaner commit history by applying the feature branch's changes on top of the main branch, avoiding unnecessary merge commits. This promotes a more straightforward and readable history.
Loading...
Related Quiz
- A developer accidentally committed a file that should not be tracked by Git. What command should they use to rectify this before pushing?
- How does Git ensure data integrity in large repositories?
- How does Git facilitate the practice of Infrastructure as Code (IaC) in DevOps?
- What is the purpose of cherry-picking in Git?
- How should a distributed team structure their Git branches to optimize collaboration?