Rebase and Resolve Conflicts
What to do when the remote has moved: recovering from divergence, pulling and rebasing, force-with-lease, resolving conflicts and continuing or aborting, detached HEAD, and the errors that come with all of it.
Recovering from divergence
When a push is rejected because the remote moved on, Review Hub's Push failed banner reads "The remote has N new commits. Pull and rebase before pushing." Two recovery paths follow: Pull and rebase, and Force push… when it is safe to offer.
Pull and rebase
Pull and rebase opens one confirmation, the same one wherever you start it: the push-failure banner, the readiness rail's Pull and rebase action, Git > Pull and rebase on a worktree card, the command palette, or the recovery banner on a terminal push error. Confirm and the rebase runs against the branch's upstream. If it hits conflicts mid-replay, the working tree drops into the conflict view below.
The dialog is titled "Pull and rebase local commits?" and names no ref in the heading. Its description names the consequence concretely: each replayed commit becomes a new commit with a different hash, and anything pointing at the old ones stops matching. "Cannot be undone" is not something you can act on; "the hashes change" is the fact that breaks things.
Under it, a Rewrites row names your branch (Branch when nothing would be rewritten) and an Onto row names the upstream, the ref the rebase integrates from, not the push destination, which in a fork workflow is a different repository. Beside it, the incoming count: 3 incoming, or no incoming commits as of the last fetch. Then come the commits themselves, in the order the rebase applies them:
- Incoming commits from the upstream: what you are about to be rebuilt on.
- Commits to replay: the real replay set, measured
--no-merges --cherry-pick --right-onlyagainst the upstream, so merge commits and commits the upstream already holds as equivalent patches are excluded. Short hash, subject and author, with a total.
A closing line reminds you that the pull fetches first, so anything pushed to the upstream since your last fetch comes in too, and that a conflicting replay stops mid-rebase for you to resolve.
A broken read never renders as "nothing to replay". If git fails, the dialog reports Couldn't read which commits this would replay with git's own message and a Retry, and the primary stays disabled.
A measured answer is settled and approvable. Nothing incoming and nothing to replay, as of the last fetch means the branch is level with its upstream. When there are incoming commits but no local commit the rebase would replay on top of them, the replay list says None and names the branch.
An upstream that is configured but has never been fetched into this worktree is a third thing again, and it blocks: Nothing to compare against yet, with git fetch <remote> to run. There is no local ref to subtract from, so the set was not measured, and a dialog whose whole job is showing what gets rewritten will not approve past the one state where it cannot answer.
Neither empty answer claims a fast-forward, and neither should be read as one. Because the set is measured --cherry-pick --right-only, a branch carrying merge commits, or commits the upstream already holds as equivalent patches, measures empty here too. Those are local-only commits the rebase drops rather than replays.
Other states block the primary and say what to do, on a line beside the buttons: a repository operation already in progress, a detached HEAD (No branch checked out), a repository with no remote (No remote to pull from), a branch that tracks nothing (No upstream to rebase onto, with git branch --set-upstream-to=<remote>/<branch>), unresolved conflicts (resolve and stage them in Review Hub first), and uncommitted changes to tracked files (commit or stash them, then retry).
Force push
Force push… appears only when Daintree captured a lease for the remote branch at the moment of rejection. Without that lease, --force-with-lease would silently degrade to a plain --force if a background fetch advanced the tracking ref between the rejection and your click, so the button is suppressed rather than offered unsafely. The worktree card's Git menu shows Force push with lease… under the same condition.
It opens a dialog titled with your branch ("Force push 'main'?"). The body says it rewrites the resolved destination to match your local branch and discards any remote commits that aren't in your local history, names the lease commit it will only proceed against, and lists the Remote commits to discard with hash, message and author. Both the rows and the total come from the same range against the resolved destination, so the preview cannot describe a different repository from the one being written.
Force push uses --force-with-lease: it only overwrites the remote if it still matches what Daintree saw when the push was rejected, so it will not clobber a teammate's newer work. It will still discard every remote commit in the list. Pull and rebase is the safer default.
Integrating the base branch
The worktree card's Git submenu separates updating from your upstream from integrating the branch your work will eventually merge into. Pull and rebase follows the current branch's configured upstream. Rebase onto <base>… and Merge <base> in… integrate the base named on the card.
- Commit or stash uncommitted changes before starting a base integration.
- Use Git > Fetch when you need current remote refs. Fetch and prune also removes stale remote-tracking refs. Fetch does not merge into your branch or change working files.
- Choose rebase to replay the branch's work on the base, or merge to integrate it without rewriting existing commits. Review the resolved refs and preview in the confirmation before proceeding.
- If conflicts stop the operation, resolve them in Review Hub. The card menu swaps the base rows for Continue rebase and Abort rebase… (or the merge equivalents) while the operation is in progress.
Base integration does not fetch automatically. It uses the currently available comparison ref, preferring the base branch's remote-tracking target where available, and verifies the previewed refs before the write. A disabled base row says why beside it: No base branch, No branch checked out, Checking status…, Commit or stash first, or Up to date. The main-process checks also reject an existing repository operation and integrating a branch into itself.
These are different from Push, which publishes to the branch's push destination. In a fork workflow that destination may differ from both upstream and base. The card disables Push with Nothing to push when its upstream ahead count is zero; the command palette or Review Hub can still resolve and preview the actual push destination.
Source reference: Git write validation and base integration.
Resolving conflicts
Review Hub resolves conflicts in place. When a worktree is mid-operation (a merge, rebase, cherry-pick, or revert), the file list is replaced by a conflict panel.
Operation chrome
A band at the top names the operation: Resolve rebase conflicts, Resolve merge conflicts, and so on, turning into Ready to continue rebase once nothing is left to resolve. For a rebase it also shows a Step N of M badge. The line beneath it says what to do next: 2 conflicted files to resolve before continuing, then Continue to replay the remaining commits mid-rebase, or Continue to finish the merge.
Abort rebase (or Abort merge, and so on) backs the whole operation out. Its confirmation spells out what gets discarded and restored for that operation type, such as how many staged resolutions are thrown away and how many already-replayed commits are reverted, with Keep working as the way out.
Rebase sequence rail
During a rebase, a Rebase sequence list above the worklist shows the full commit sequence so you can see where you are, and keeps the current step scrolled into view. Each row shows the action (PICK, FIXUP and so on), the short hash and the subject. Done commits carry a check, the current commit is bold on a highlighted row with a chevron, pending commits show a dashed circle, and dropped commits are struck through. Fixup and squash commits sit indented under their parent.
The worklist
Each conflicted file shows an error mark, its path, a label like "both modified", and how many conflict regions remain. During a rebase the label names the sides for what they are ("deleted by destination", not "deleted by us"). Per file you can:
- Open: jump to the file in your external editor at the first conflict marker.
- Mark resolved: stage the file once you have handled it by hand. Daintree re-checks the file for leftover conflict markers first. If any remain, it asks before staging the markers as file content; if it couldn't check, it asks whether to mark the file resolved without checking.
- The ··· menu: resolve the whole file one way. During a rebase the choices are Use destination branch (ours) and Use incoming commit (theirs); for a merge, cherry-pick or revert they are Use current branch and Use incoming changes. Each asks first, because it overwrites the file and discards any manual conflict edits in it.
Resolved files collapse into a Resolved disclosure with a count. Continue rebase (or the operation's equivalent) is enabled only once no conflicts remain.
Detached HEAD
In a detached HEAD state the composer's textarea is disabled and its status line explains, with a warning mark, that you need to switch to a branch to commit. Detached HEAD is also a readiness blocker, so the rail says so before you reach for the composer.
git checkout -b BRANCH-NAME.Errors and auto-refresh
If git status fails to load, a Couldn't load changes banner with a Retry button replaces the file lists. A push refused because too many were attempted in a short window says to wait a moment and try again, rather than showing a raw error.
Review Hub watches the worktree and refreshes in the background, so the lists stay current while an agent writes files. Your scroll position is kept, and the surface takes a stale treatment (dimmed, and marked busy for assistive technology) while a refresh is in flight rather than tearing down to a skeleton.