Skip to content

path

Copy page

Prints the filesystem path of an existing worktree. Useful for scripting or quickly navigating to a worktree directory.

Terminal window
workrex path <name>
  • <name>: Worktree name (the directory name).
/Users/you/project__worktrees/user-auth
# Get the path of a worktree
workrex path user-auth
# Use in scripts or with cd
cd "$(workrex path user-auth)"
# Copy a file to a worktree
cp config.json "$(workrex path feature-branch)/"