If a branch must live more than a few days, rebase it on main daily to minimize the final-merge pain.
Discipline:
git fetch origin
git rebase origin/main
Resolve conflicts as they arise. Conflicts found a day in are 100× easier than two weeks in.
Force-push after rebase:
git push --force-with-lease
If the branch is shared with a reviewer mid-PR, communicate before rebasing. Or use git merge origin/main instead — keeps reviewer's place but adds merge commits.
If conflicts get truly nightmarish: git rerere.enabled true makes Git remember your resolutions and replay them automatically next rebase.