Workspaces

desk new

Start scratch work, choose a repository workspace, or create an independent clone.

Usage#

Usage

desk new [REPOSITORY] [--fresh|--choose|--reuse]

Arguments#

REPOSITORYoptional

Leave it out for an empty workspace. Otherwise choose or create a workspace for that repository. Accepted forms:

  • owner/repo, which means https://github.com/owner/repo.git;
  • a Git URL: https://…, ssh://…, git@host:owner/repo, or file://…;
  • a local path starting with /, ./, or ../.

Behavior#

  • When creating a workspace, desk picks an unused two-word name such as drifting-tundra and creates ~/.desk/workspaces/drifting-tundra.
  • With shell integration, your shell moves into the workspace.
  • For a repository, the default chooser offers existing workspaces and a new clone. owner/repo, https://github.com/owner/repo, and git@github.com:owner/repo.git all count as the same source.
  • --fresh creates an independent clone, even if other workspaces have that source.
  • --reuse reuses the most recently used workspace for that repository, or creates one if needed. It remembers this per-repository preference for later unflagged invocations.
  • --choose opens the chooser for this invocation, overriding but not changing a remembered reuse preference.
  • Use only one mode flag. No task name is required; use desk rename later if useful.
  • desk never pulls, fetches, or resets an existing clone.
  • If the clone fails, the new workspace is removed.

Examples#

Terminal

desk new

Output

desk: created drifting-tundra

Terminal

desk new octocat/Hello-World

Output

Cloning into '/home/you/.desk/workspaces/misty-ember'...
desk: created misty-ember

To create another independent clone of the same repository:

Terminal

desk new https://github.com/octocat/hello-world --fresh

See repository workspaces for repository matching and reuse preferences.

Output#

The workspace's absolute path on standard output, messages on standard error. Without shell integration, cd "$(desk new)" does the same thing.