Skip to content

feat: parsec start --branch for existing branches#47

Merged
erishforG merged 1 commit intodevelopfrom
feature/46
Apr 15, 2026
Merged

feat: parsec start --branch for existing branches#47
erishforG merged 1 commit intodevelopfrom
feature/46

Conversation

@erishforG
Copy link
Copy Markdown
Owner

Summary

  • Add --branch flag to parsec start that creates a worktree from an existing local or remote branch instead of creating a new one
  • If the branch exists only on remote, it is automatically fetched and tracked locally
  • If the branch doesn't exist anywhere, a clear error is shown

Closes #46

Changes

  • src/git/mod.rs — New worktree_add_existing() function handling local/remote branch resolution
  • src/worktree/manager.rscreate() accepts existing_branch parameter
  • src/cli/mod.rs--branch flag on Start command variant
  • src/cli/commands.rs — Pass existing_branch through to manager
  • README.md — Updated docs with --branch examples
  • docs/index.html — Added feature card and comparison table row

Usage

# Attach to a local branch
parsec start CL-2208 --branch feature/CL-2208

# Attach to a remote-only branch (auto-fetches)
parsec start CL-2208 --branch origin/feature/CL-2208

Test plan

  • parsec start TEST-1 --branch <existing-local-branch> creates worktree correctly
  • parsec start TEST-2 --branch <remote-only-branch> fetches and creates worktree
  • parsec start TEST-3 --branch nonexistent gives clear error
  • cargo build && cargo clippy && cargo fmt --check all pass

🤖 Generated with Claude Code

Allow `parsec start` to attach to an existing local or remote branch
instead of always creating a new one. If the branch exists only on
remote, it is fetched and tracked automatically.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@erishforG erishforG merged commit ed28af8 into develop Apr 15, 2026
7 checks passed
@erishforG erishforG deleted the feature/46 branch April 16, 2026 07:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant