Rebasing Long-Running Work
Question
If you're working on some long task, when would you try to rebase on main branch? How often would you do that?
Short interview answer
Rebase an unshared feature branch onto the current main branch when updated main-line changes affect the work or before integration, at a cadence that keeps conflicts manageable. Avoid rewriting commits that collaborators already depend on unless the team has explicitly agreed on that workflow.
Detailed answer
There is no universal interval such as “every day.” For a multi-week feature, integrate current main often enough that conflicts are still understandable—especially after changes to shared APIs, build configuration, or nearby code. Rebase is suitable when the branch is private or the team agrees that it may be force-updated. If the branch is shared, merge main into it instead, or coordinate the rewrite, because rebase creates new commit identities. Before opening a pull request, update from main, resolve and test conflicts, then make the integration state visible to reviewers.