Setup User
For your commit history, you will have to set up your local Oxen user name and email. This is what will show up inoxen log or in the OxenHub dashboard for who changed what.
Push Your Data
If you already have a dataset, you can easily create a local and remote repo from your CLI.Clone
There are a few ways that you can clone an Oxen repository, depending on the level of data transfer you want to incur. The defaultoxen clone with no flags will download the latest commit from the main branch.
-b flag.
Shallow Clone
Downloading all the data may still be a more expensive operation than you need. You can download the minimal metadata to still interact with the remote by using the--shallow flag.
--shallow flag you will notice no data files in your working directory. You can still see the data on the branch on the remote with the oxen remote subcommands.
oxen download. This is useful if you only need a specific set of files and directories for training or testing.
Clone All
Lastly, if you want to clone the entire commit history locally, you can use the--all flag. This is handy if you want to pull a full history and push to a new remote, or have a workflow where you need to quickly swap between commits locally. Often for running experiments, training, or testing, all you need is a subset of the data.
Initialize Local Repository
If you do not have a remote dataset, you can initialize one locally. Similar to git: create a new directory, navigate into it, and performStage Data
You can stage changes that you are interested in committing with theoxen add command and giving a full file path or directory.
View Status
To see what data is tracked, staged, or not yet added to the repository you can use thestatus command.
Note: since we are dealing with large datasets with many files, status rolls up the changes and summarizes them for you.
-s (skip) and -l (limit) params on the status command. Run oxen status --help for more info.
Commit Changes
To commit the changes that are staged with a message you can useLog
You can see the history of changes on your current branch by running:Reverting To Commit
If ever you want to change your working directory to a point in your commit history, you can simply supply the commit id from your history to thecheckout command.
Restore Working Directory
Therestore command comes in handy if you made some changes locally and you want to revert the changes. This can be used for example if you accidentally delete or modify or stage a file that you did not intend to.
Removing Data
To stage a file to be removed from the next commit, use theoxen rm command. Removing data from a commit can be useful if you find errors or simply want to create a smaller subset of data on a separate branch for debugging or testing.
-r flag.
oxen rm with the --staged flag to unstage the file or directory.