Skip to content

Add wt step sync (or similar) for merging main into feature branch without rebase #487

@hugobarauna

Description

@hugobarauna

Problem

When a feature branch has already been pushed to origin for code review, the current wt step rebase workflow requires force-pushing after syncing with main, which rewrites shared history.

In traditional git workflows, once a branch is shared/pushed for review, the common practice is to merge main INTO the feature branch (rather than rebase) to avoid rewriting history and requiring force pushes.

Current workaround

Use plain git commands:

git fetch origin
git merge origin/main

Proposed solution

A new step command like wt step sync or wt step update that:

  1. Fetches from origin
  2. Merges the default branch (or specified target) INTO the current branch
  3. Preserves commit history (no rebase)

Example usage:

wt step sync          # merge origin/main into current branch
wt step sync develop  # merge origin/develop into current branch

Use case

  1. Create feature branch with wt switch --create feature
  2. Work, commit, push for code review
  3. Main branch advances while PR is in review
  4. Need to sync with main → use wt step sync instead of wt step rebase
  5. Push normally (no force push needed)
  6. When approved, use wt merge as usual

This would complement the existing rebase-based workflow for scenarios where history preservation matters.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions