hpr3307 :: Git worktree
How to use git worktree
Hosted by klaatu on 2021-04-06 is flagged as Clean and is released under a CC-BY-SA license.
Tags: git,tree,trunk,branch.
Listen in ogg,
spx, or
mp3 format. | Comments (0)
Part of the series: Introduction to Git
Initiated by Klaatu, this open series introduces Git and the concepts behind its use in a collaborative environment.
Create a new worktree
$ git branch | tee
* dev
trunk
$ git worktree add -b hotfix ~/demo/penguin.tree trunk
Preparing ../penguin.tree (identifier penguin.tree)
HEAD is now at 62a2daf commit
List existing worktrees
$ git worktree list
/home/tux/demo/penguin.git 15fca84 [dev]
/home/tux/demo/penguin.tree 09e585d [trunk]
Move a worktree
$ git worktree move penguin.tree ~/Temp
Remove a worktree
$ git worktree remove penguin.tree