Explain the difference between git merge and git rebase. When would you use one over the other?
- `git merge` combines branches and preserves history
- `git rebase` rewrites history by applying commits on top of another branch
- Use merge for shared repos; rebase for cleaner local history
- 💡Think: history preservation vs linear history
- ⚠️Misunderstanding that `git rebase` rewrites commit history, leading to confusion or issues.
- ⚠️Rebasing branches that have already been pushed to a shared remote repository (rebasing public history).
- ⚠️Not understanding the difference in the resulting history graph (linear vs. branching).
- ⚠️Over-using `git rebase` in situations where `git merge` would provide better historical context.
- ⚠️Focusing too much on the command syntax rather than the practical implications for team collaboration and project history.
- ❓When would rebase cause conflicts?
- ❓Why avoid rebasing public branches?
Ready to prove your AWS DevOps knowledge?
Practice with free DevOps Engineer Professional (DOP-C02) exam questions. Instant answers and detailed explanations — no account required.
Start free practice quizQuestions that share similar topics with this one
Deepen your knowledge with these related blog posts
Monorepo vs Polyrepo: Choosing the Right Repository Strategy for Your Microservices
A comprehensive guide to choosing between monorepo and polyrepo strategies when decomposing monoliths into microservices. Learn the trade-offs, implementation patterns, and real-world considerations that matter in production.
GitHub Self-Hosted Runners on AWS: Pull vs Push for On-Demand Scaling
Cut your CI costs by running GitHub Actions on AWS only when you need them. Compare pull-based (polling) and push-based (event-driven) architectures for spinning up on-demand self-hosted runners.
From Terraform to GitOps: A Practical Migration Roadmap
A step-by-step guide to migrating from traditional Terraform workflows to GitOps, including migration patterns, common pitfalls, and practical diagrams to guide your journey.