oxen.repo
Repo Objects
Examples
Init, Add, Commit and Push
Adding and committing a file to a remote workspace.__init__
path-strPath to the main working directory of your oxen repo.mkdir-boolWhether to create the directory if one doesnβt exist. Default: False
init
clone
url-strThe url of the remote repository. ex) https://hub.oxen.ai/ox/chatbotbranch-strThe name of the branch to clone. Default: mainall-boolWhether to clone the full commit history or not. Default: Falsefilters-str | list[str] | NoneFilter down the set of directories you want to clone. Useful if you have a large repository and only want to make changes to a specific subset of files. Default: None
branches
branch
branch_exists
checkout
revision-strThe name of the branch or commit id to checkout.create-boolWhether to create a new branch if it doesnβt exist. Default: False
add
add_schema_metadata
rm
oxen restore --staged <path> to
unstage the removal and then oxen restore <path>.
With staged=True the path is removed from the staging area and the
working-tree copy is left in place. This unstages an earlier add or
removal, and the path need not be committed.
Arguments:
path-strThe path to the file or directory to remove.recursive-boolWhether to remove the file or directory recursively. Default: Falsestaged-boolWhether to remove the path from the staging area without deleting the working-tree copy. Default: False
restore
staged=True the staged entry is discarded instead and the working copy
is left alone, so undoing an rm takes both, staged first.
Arguments:
path-strThe path to the file or directory to restore.staged-boolDiscard the staged entry rather than the working copy. Default: Falsesource-strCommit id or branch name to take the contents from, when restoring the working copy. Defaults to HEAD, and has no effect withstaged=True.
clean
force=True this is a dry-run β the returned object lists what
would be removed but nothing is deleted. Pass force=True to actually
delete.
Matches the oxen clean CLI: tracked files, .oxen/, and
.oxenignore-matched files are never touched.
Arguments:
paths-list[str] | NoneOptional list of paths to scope the cleanup.None(the default) means the whole working tree.force-boolActually remove. Without this the call is a dry-run. Default: False
CleanResult with .files, .dirs, .total_bytes, and .applied
attributes.
status
commit
message-strThe commit message.
log
set_remote
url and records its identifier alongside the name and
url, so the remote has to be reachable and the repository has to exist.
Arguments:
name-strThe name of the remote. Ex) originurl-strThe url you want to map the name to. Ex) https://hub.oxen.ai/ox/chatbot
PyOxenError- If the repository aturlcannot be read, or ifnameis already attached to a different repository.
push
remote_name-strThe name of the remote to push to.branch-strThe name of the branch to push to.
pull
remote_name-strThe name of the remote to pull from.branch-strThe name of the branch to pull from.all-boolWhether to pull all data from branch history or not. Default: False