Workspaces
desk new
Start scratch work, choose a repository workspace, or create an independent clone.
Usage#
Usage
desk new [REPOSITORY] [--fresh|--choose|--reuse]Arguments#
REPOSITORYoptionalLeave it out for an empty workspace. Otherwise choose or create a workspace for that repository. Accepted forms:
owner/repo, which meanshttps://github.com/owner/repo.git;- a Git URL:
https://…,ssh://…,git@host:owner/repo, orfile://…; - a local path starting with
/,./, or../.
Behavior#
- When creating a workspace, desk picks an unused two-word name such as
drifting-tundraand 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, andgit@github.com:owner/repo.gitall count as the same source. --freshcreates an independent clone, even if other workspaces have that source.--reusereuses the most recently used workspace for that repository, or creates one if needed. It remembers this per-repository preference for later unflagged invocations.--chooseopens 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 renamelater if useful. - desk never pulls, fetches, or resets an existing clone.
- If the clone fails, the new workspace is removed.
Examples#
Terminal
desk newOutput
desk: created drifting-tundraTerminal
desk new octocat/Hello-WorldOutput
Cloning into '/home/you/.desk/workspaces/misty-ember'...
desk: created misty-emberTo create another independent clone of the same repository:
Terminal
desk new https://github.com/octocat/hello-world --freshSee 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.