How can I rename a git worktree

Viewed 859

Given I have run

$ git worktree add ~/worktrees/a
$ cd ~/worktrees/a
$ git status
On branch a

I would like to instead change the name of the worktree and branch from a to b.

1 Answers

One option for achieving this (that I ended up doing) is:

$ git worktree move ~/worktrees/a ~/worktrees/b
$ cd ~/worktrees/b
$ git branch -m b
Related