hopsworks.git_repo #
GitRepo #
Returned by
id property #
Id of the git repo.
name property #
Name of the git repo.
path property #
Path to the git repo in the Hopsworks Filesystem.
creator property #
Creator of the git repo.
provider property #
Git provider for the repo, can be GitHub, GitLab or BitBucket.
current_branch property #
The current branch for the git repo.
current_commit property #
The current commit for the git repo.
read_only property #
If True then the repository functions GitRepo.commit, GitRepo.push and GitRepo.checkout_files are forbidden.
status #
status() -> list[GitFileStatus]
Get the status of the repo.
| RETURNS | DESCRIPTION |
|---|---|
list[GitFileStatus] | The list of file statuses for the git repo. |
| RAISES | DESCRIPTION |
|---|---|
hopsworks.client.exceptions.RestAPIError | If the backend encounters an error when handling the request. |
delete #
delete()
Delete the git repo from the filesystem.
Potentially dangerous operation
This operation deletes the cloned git repository from the filesystem.
| RAISES | DESCRIPTION |
|---|---|
hopsworks.client.exceptions.RestAPIError | If the backend encounters an error when handling the request |
checkout_branch #
Checkout a branch.
| PARAMETER | DESCRIPTION |
|---|---|
branch | Name of the branch. TYPE: |
create | If TYPE: |
| RAISES | DESCRIPTION |
|---|---|
hopsworks.client.exceptions.RestAPIError | If the backend encounters an error when handling the request. |
checkout_commit #
checkout_commit(commit: str)
Checkout a commit.
| PARAMETER | DESCRIPTION |
|---|---|
commit | Hash of the commit. TYPE: |
| RAISES | DESCRIPTION |
|---|---|
hopsworks.client.exceptions.RestAPIError | If the backend encounters an error when handling the request. |
checkout_files #
checkout_files(files: list[str] | list[GitFileStatus])
Checkout a list of files.
| PARAMETER | DESCRIPTION |
|---|---|
files | List of files or GitFileStatus objects to checkout. TYPE: |
| RAISES | DESCRIPTION |
|---|---|
hopsworks.client.exceptions.RestAPIError | If the backend encounters an error when handling the request. |
delete_branch #
delete_branch(branch: str)
Delete a branch from local repository.
| PARAMETER | DESCRIPTION |
|---|---|
branch | Name of the branch to delete. TYPE: |
| RAISES | DESCRIPTION |
|---|---|
hopsworks.client.exceptions.RestAPIError | If the backend encounters an error when handling the request. |
commit #
Add changes and new files, and then commit them.
| PARAMETER | DESCRIPTION |
|---|---|
message | Commit message. TYPE: |
all | Automatically stage files that have been modified and deleted, but new files are not affected. TYPE: |
files | List of new files to add and commit. |
| RAISES | DESCRIPTION |
|---|---|
hopsworks.client.exceptions.RestAPIError | If the backend encounters an error when handling the request. |
push #
Push changes to the remote branch.
| PARAMETER | DESCRIPTION |
|---|---|
branch | Name of the branch. TYPE: |
remote | Name of the remote. TYPE: |
| RAISES | DESCRIPTION |
|---|---|
hopsworks.client.exceptions.RestAPIError | If the backend encounters an error when handling the request. |
pull #
Pull changes from remote branch.
| PARAMETER | DESCRIPTION |
|---|---|
branch | Name of the branch. TYPE: |
remote | Name of the remote. TYPE: |
| RAISES | DESCRIPTION |
|---|---|
hopsworks.client.exceptions.RestAPIError | If the backend encounters an error when handling the request. |
fetch #
Fetch changes from remote.
| PARAMETER | DESCRIPTION |
|---|---|
remote | Name of the remote. TYPE: |
branch | Name of the branch. TYPE: |
| RAISES | DESCRIPTION |
|---|---|
hopsworks.client.exceptions.RestAPIError | If the backend encounters an error when handling the request. |
reset #
Reset the branch to a specific commit or to a local branch or to a remote branch.
| PARAMETER | DESCRIPTION |
|---|---|
remote | Name of the remote. TYPE: |
branch | Name of the branch. TYPE: |
commit | Hash of the commit. TYPE: |
| RAISES | DESCRIPTION |
|---|---|
hopsworks.client.exceptions.RestAPIError | If the backend encounters an error when handling the request. |
get_commits #
Get the commits for the repo and branch.
| PARAMETER | DESCRIPTION |
|---|---|
branch | Name of the branch. TYPE: |
| RETURNS | DESCRIPTION |
|---|---|
list[git_commit.GitCommit] | The list of commits for this repo. |
| RAISES | DESCRIPTION |
|---|---|
hopsworks.client.exceptions.RestAPIError | If the backend encounters an error when handling the request. |
add_remote #
Add a remote for the repo.
import hopsworks
project = hopsworks.login()
git_api = project.get_git_api()
repo = git_api.get_repo("my_repo")
repo.add_remote("upstream", "https://github.com/organization/repo.git")
| PARAMETER | DESCRIPTION |
|---|---|
name | Name of the remote. TYPE: |
url | Url of the remote. TYPE: |
| RETURNS | DESCRIPTION |
|---|---|
GitRemote | The created remote. |
| RAISES | DESCRIPTION |
|---|---|
hopsworks.client.exceptions.RestAPIError | If the backend encounters an error when handling the request. |
get_remote #
Get a remote by name for the repo.
| PARAMETER | DESCRIPTION |
|---|---|
name | Name of the remote. TYPE: |
| RETURNS | DESCRIPTION |
|---|---|
GitRemote | The git remote metadata object or |
| RAISES | DESCRIPTION |
|---|---|
hopsworks.client.exceptions.RestAPIError | If the backend encounters an error when handling the request. |
get_remotes #
Get the configured remotes for the repo.
| RETURNS | DESCRIPTION |
|---|---|
list[GitRemote] | All remotes of the git repo. |
| RAISES | DESCRIPTION |
|---|---|
hopsworks.client.exceptions.RestAPIError | If the backend encounters an error when handling the request. |