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
.
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
.
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
git worktree
command came about because people find it useful to have more than one working tree. –
Dowry .git/worktrees/a
(!) –
Unwieldy cd ~/worktrees/b
you should run git worktree repair
to restablish the connection to the main tree. If you also moved the main tree then use git worktree repair [path-to-worktree]
inside the main tree. See documentation. –
Wetnurse Not a git expert, but I feels like git worktree move <worktree> <new-path>
would do the trick.
See the official documentation.
© 2022 - 2024 — McMap. All rights reserved.