Local Repo#
- class oxen.LocalRepo(path: str = '')#
Local repository object that allows you to interact with your local oxen repo.
- add(path: str)#
Stage a file or directory to be committed.
- checkout(revision: str, create=False)#
Checkout a branch or commit id.
- Parameters:
revision (str) β The name of the branch or commit id to checkout.
create (bool) β Whether to create a new branch if it doesnβt exist. Default: False
- clone(url: str, branch: str = 'main', shallow=False, all=False)#
Clone repository from a remote url.
- Parameters:
url (str) β The url of the remote repository. ex) https://hub.oxen.ai/ox/chatbot
branch (str) β The name of the branch to clone. Default: main
shallow (bool) β Whether to do a shallow clone or not. Default: False
all (bool) β Whether to clone the full commit history or not. Default: False
- commit(message: str)#
Commit the staged data in a repo with a message.
- Parameters:
message (str) β The commit message.
- property current_branch#
Returns the current branch.
- init()#
Initializes a new oxen repository at the path specified in the constructor. Will create a .oxen folder to store all the versions and metadata.
- log()#
Get the commit history for a repo.
- property path#
Returns the path to the repo.
- pull(remote_name: str = 'origin', branch: str = 'main')#
Pull data from a remote repo to a local repo.
- Parameters:
remote_name (str) β The name of the remote to pull from.
branch (str) β The name of the branch to pull from.
- push(remote_name: str = 'origin', branch: str = 'main')#
Push data to a remote repo from a local repo.
- Parameters:
remote_name (str) β The name of the remote to push to.
branch (str) β The name of the branch to push to.
- set_remote(name: str, url: str)#
Map a name to a remote url.
- Parameters:
name (str) β The name of the remote. Ex) origin
url (str) β The url you want to map the name to. Ex) https://hub.oxen.ai/ox/chatbot
- status()#
Check the status of the repo. Returns a StagedData object.