Sync a worktree with the latest changes from the default/base branch
Update a worktree by rebasing it on the latest base branch changes. Use this to sync feature branches with main/develop without merging.
/plugin marketplace add horuz-ai/claude-plugins/plugin install core@horuz<worktree-name> [base-branch]git/pwdgit rev-parse --show-toplevel 2>/dev/null || echo "Not in a git repo"git worktree list 2>/dev/null || echo "No worktrees found"git remote show origin 2>/dev/null | grep 'HEAD branch' | sed 's/.*: //' || echo "unknown"feat-new-feature)Update a worktree with the latest changes from the base branch.
Determine the base branch:
git remote show origin | grep 'HEAD branch' | sed 's/.*: //'main, master, develop, or whatever the repo usesFetch latest from origin:
git fetch origin from the main repoNavigate to the worktree:
../$1Check for uncommitted changes:
git status --porcelaingit stash push -m "worktree-sync auto-stash"Rebase on base branch:
git rebase origin/[base-branch]Restore stashed changes:
git stash popReinstall dependencies if needed:
git diff HEAD@{1} --name-only | grep -E "(package.json|pnpm-lock.yaml)"pnpm installReport success:
main