Workspace Structure
A repository’s workspaces are stored in theworkspaces folder of the .oxen hidden dir. Each workspace has a workspace_id or workspace_name with which it can be identified, as well as the commit_id of the commit in the repository that the workspace points to. You can have multiple workspaces for the same commit_id so long as they each have a different workspace_id
Workspaces are useful when you want to work with a repository without downloading all of the data for it locally. To interact with one, you don’t have to have the remote repository’s contents pulled locally – you only need a local repo that’s pointing to the remote
oxen workspace add, you’re not writing any data to your local machine – Oxen processes and uploads the files directly to the remote. This allows you to avoid copying the files to a local repository like you would if you use the add --> commit --> push workflow, speeding up the operation and saving space on your machine
Instantiating a Workspace
Create a workspace with a remote repository and a branch name.commit_id will be updated to the newly created commit. Use a named workspace if you want make multiple commits with the same workspace
List Workspaces
You can list the workspaces for a remote usingoxen workspace list
Adding Files
Useoxen workspace add to stage files to the workspace. This uploads the files’ contents directly to the server
Removing staged files
If you want to remove files staged to a workspace, you can unstage them withoxen workspace rm --staged.
Removing files from the base repo
On the other hand, you can use workspaces to remove files from the repository they’re based on. Stage files for removal withoxen workspace rm