Hey everyone,
I’m working on a project where feature branches tend to get really big before merging.
What’s the best way to manage these large branches in Git?
Should I rebase often?
Or just merge regularly from main?
Would love to hear how you handle this in your projects to avoid messy histories or conflicts.
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
Heya, @yolandasmith
If the branch is only used by you, rebasing often on top of main is great. It keeps history linear and reduces the size of each conflict.
If multiple people are working on the same feature branch, avoid rebasing once others have pulled it. In that case, regularly merging main into the feature branch is safer. The history is a bit messier, but no one gets surprised by rewritten commits.
Regards
Hi,
Large feature branches tend to cause trouble when they drift too far from main. The safest way to keep things manageable is to sync them often. If you’re the only one on the branch, rebasing keeps the history clean. If multiple people are pushing to it, merging main into the branch is usually safer since it avoids rewriting commits.
The real trick is to avoid letting the branch sit untouched for long periods. Small, regular updates mean fewer conflicts and a much smoother merge at the end. If you want a quick refresher on the core Git concepts behind this, this guide walks through them clearly: https://devops-daily.com/guides/introduction-to-git
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.