Versioning 101
On the surface,oxen looks a lot like git. Users can add, commit, data locally then push to a remote server. Similar to git, by default oxen will create a local copy of the data on your machine in your .oxen directory before pushing to the remote server.
oxen comes with a remote oxen-server that userβs can sync data to. This server also allows you to upload data directly without making local copies.
Interfaces
The server exposes a REST API that can be used to interact with data. Oxen.aiβs clients include a command line interface, as well as bindings for Rust π¦, Python π, and HTTP interfaces π to make it easy to integrate into your workflow.Installation
Oxen makes versioning your datasets as easy as versioning your code. You can install through homebrew or pip or from our releases page.Remote Workflow
Centralized version control systems like Oxen.ai allow you to have remote first workflows where you do not need to have a fully copy of the data on your local machine. Decentralized version control systems like git by default duplicate all the data to every node in your network.
Create a Remote Repository
If you do not already have a remote repository, you can create one with a singleREADME.md and initial commit so it is immediately cloneable.
README.md and no initial commit β pass empty=True from Python, or simply omit --add_readme from the CLI.
Add Files
You can add files to the remote repository by passing the path to the file and the destination directory. This will upload the file to the remote repository and stage it for commit.Commit Changes
You can commit changes to the remote repository by passing a message.File Exploration
To see the files in the remote repository you can usels.
ls method.
Note: the directories are paginated so you will need to use the page_num parameter to view the next page of results.
There are also total_pages, page_number, and total_entries attributes that give you information about the pagination.
Downloading Data
You can download individual files and folders if you do not need the entire data repository for your job.Checkout a Branch
If you have a data on a separate branch that you want to view you can checkout a branch by passing the branch name to thecheckout method.
Create a New Branch
Thecheckout method also allows you to create a new branch if the branch does not exist.
View Branches
To see all the branches in the remote repository you can use thebranches method.
Workspaces
Under the hood, the way that we enable remote collaboration is through a concept called a workspace. A workspace can be thought of as an uncommitted working directory that is stored on the server. Just like you canadd files before committing locally, you can add files to a workspace on the remote server before committing. This allows you to build up a set of changes remotely before committing them in bulk.
RemoteRepo.add method is a shortcut for creating a workspace and adding files to it. It creates a ephemeral workspace and adds the files to it, and deletes the workspace after committing.
To learn more about workspaces, check out the workspaces documentation.
Clone a Remote Repository
Remote repositories are identified by a remote URL. This is the URL that you can use to clone the repository.Python
Python
Local Workflow
Local workflow looks a lot like git. The downside is that you have to duplicate all the data locally. The good news is that oxen is much faster than git for large files and repositories.Initialize User
Each change you make will be associated with a name and email. Set them before you get started so you know who changed what. The user data is saved by default in~/.config/oxen/user_config.toml.
Create Repository
Initialize your first Oxen repository, and commit the first version of your data.Create Branch
It is good practice to create a new branch for changes you make to your data. This will allow you to easily compare the parallel versions of your data over time.Delete Branch
Once finished with a branch, you can delete it.Status
Check the current state of your local repository by usingoxen status. Instead of printing out every file that was added/modified/removed (which is unsustainable for large repositories), oxen summarizes the changes and lets you page through them.
Restore Changes
If you are not happy with the changes you made to your data, you can restore them to the previous commit with theoxen restore command.
Commit Changes
Once you are happy with the changes you have made to your data, you can commit them to the repository with a new message.View Commit History
To see the commit history of your repository, you can use theoxen log command.
Checkout Main Branch
Once you are done making changes to your data, you can return to the main branch with theoxen checkout command.
Never fear, the file now has now been reverted to the inital commit again, but your changes will be saved in the branch you created.
List Branches
To see the branches in your repository, you can use theoxen branch command.
Push Data
Once your data has been committed locally, you can sync it to theoxen-server.
Oxen.ai has a web hub that allows you to collaborate on your data in the cloud. You can create a free account at https://oxen.ai.