Short answer
You don’t _have to create a new branch, but you almost certainly should. Treat a framework upgrade like any other feature or refactor: isolate it in its own branch, get it green, then merge it back to dev.
Why a separate branch is a good idea
• Keeps dev unbroken – The upgrade might take hours/days; teammates can keep working on other tasks.
• Easy rollback – If the upgrade explodes, just abandon the branch.
• Clear history – “upgrade/laravel-9” (or “feature/laravel-9”) tells everyone what happened in one quick git log.
• Safer code review – You can open a PR and have the team review the whole upgrade at once.
Typical flow (Git-Flow style)
# starting on your up-to-date dev branch
git checkout dev
git pull origin dev
# create an upgrade branch
git checkout -b upgrade/laravel-9 # or feature/laravel-9
Upgrade steps in that branch
- Make sure you have a clean working directory (
git status).
- Follow the official upgrade guide version-by-version (7 → 8 → 9).
• Update composer.json
• composer require laravel/framework:^8.0 --update-with-dependencies
• Fix breaking changes, run tests
• Bump again to 9 the same way
- Run automated tests (
phpunit), lint, CI.
- Smoke-test locally/in staging.
- Push branch to origin, open PR to dev.
When the branch is stable
# in PR or locally
git checkout dev
git pull origin dev
git merge --no-ff upgrade/laravel-9 # or use PR merge button
git push origin dev
Then continue your normal release process (merge to main or create a release branch, tag, deploy, etc.).
Edge cases / FAQ
Q: My team is tiny and I’m the only one touching dev. Can I just upgrade directly?
A: Technically yes, but you lose the rollback/review benefits. Even solo, a branch is just one extra command and gives you an escape hatch.
Q: Dev already has other ongoing features; will I get merge conflicts later?
A: Maybe. Keep your upgrade branch rebased:
git fetch origin
git rebase origin/dev # while on upgrade/laravel-9
Doing this every day prevents a giant conflict party at the end.
Q: We use trunk-based development (no long-living dev branch). Still branch?
A: Create a short-lived feature flag or hidden config and merge smaller upgrade chunks quickly, or still use a temporary branch if the change set is huge. The principle—keep main green—stays the same.
Q: Any special tagging?
A: After merging, tag v9-upgrade or vX.Y.Z so you can easily diff pre- and post-upgrade.
In summary
• Create upgrade/laravel-9 from dev.
• Upgrade, test, and fix inside it.
• Merge once green.
Your future self (and teammates) will thank you. Happy upgrading! 🎉