Guides
Repository workspaces
Clone a repository into its own workspace and return to it later.
Clone a Repository#
desk new accepts several forms of repository:
Terminal
desk new octocat/Hello-Worldowner/repo is expanded to https://github.com/owner/repo.git.
Terminal
desk new https://gitlab.com/group/project.git
desk new git@github.com:owner/repo.git
desk new ssh://git@example.com/repo.gitURLs are passed to Git as given.
Terminal
desk new ../my-projectLocal paths must start with /, ./, or ../. They are converted to an absolute path.
For a new clone, desk runs git clone into an independently named workspace and takes you there. Authentication uses your normal Git and SSH configuration. No task name is required.
Return to It#
By default, desk new REPOSITORY offers existing workspaces for that repository alongside a new clone. Different spellings identify the same source:
Terminal
desk new octocat/Hello-World
desk new https://github.com/octocat/hello-world
desk new git@github.com:octocat/Hello-World.gitdesk compares each workspace's Git origin by host and path, ignoring the scheme, user, and a trailing .git. Path case is ignored on GitHub, where it doesn't matter.
Choose explicitly when you already know what you need:
Terminal
desk new owner/repo --fresh # independent clone for another experiment
desk new owner/repo --reuse # remember reuse-MRU for this repository
desk new owner/repo --choose # chooser this time, keep remembered preference--reuse returns to the most recently used workspace for that repository, or creates one if needed. Later unflagged invocations reuse it too. --fresh requests a new clone; --choose overrides the remembered preference for just this invocation. Use only one of these flags at a time.
desk does not fetch, pull, or reset when it returns to a clone. Update it yourself with Git. You can also use desk switch NAME directly.
When a Clone Fails#
If git clone fails, desk removes the new workspace and reports Git's error. Fix the problem, such as credentials or a typo, and run desk new again.
Before Deleting#
For routine clearing, use cleanup: it excludes local-only work and active workspaces. desk rm is explicit removal: it shows a summary, asks, and moves whatever you confirm to garbage for 72 hours, even local-only work. If you're unsure, check first:
Terminal
git status --short
git log --branches --not --remotes
git stash list