Skip to content

Create worktree for already started work (eg. existing branch) #165

@ProHumanisRB

Description

@ProHumanisRB

The feature request

Worktrees are currently bit clunky to work with in GitHub Desktop Plus, at least for me.

One major pain point is, that I cannot create a new worktree from an existing branch.
The workaround is, to create a worktree with a different name than the branch (since you cannot create a new worktree with the same name as an existing branch), then checkout the existing branch, rename either the worktree or the branch (if necessary bring the changes to the other branch) and delete the unused branch.
This is very clunky.

Proposed solution

There are two solutions that come to my mind. I prefer the first solution, but I like both and I would actually propose to implement both:

Solution 1 - Create a worktree from an existing branch

  1. Have an existing branch
  2. Create new worktree with this new option (like with a right click on the branch)
  3. Worktree with same name as branch will be created and with the existing branch checked out

Solution 2 - Bring changes to new worktree (similar, but not identical to the switch branch flow)

  1. Have uncommited changes
  2. Create new worktree
  3. Get being asked if you want to bring the uncommited changes to the newly created branch (like if you switch branches, where you also get asked if you want to bring your changes with you)

The question if you want to bring your changes with you into the newly created branch created by the newly created worktree, will only be ask once on creation.

Additional context

No response

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