GitRemote API#
Handle#
get_git_api#
Project.get_git_api()
Get the git repository api for the project.
Returns
GitApi
: The Git Api handle
Creation#
add_remote#
GitRepo.add_remote(name, url)
Add a remote for the repo
import hopsworks
connection = hopsworks.connection()
project = connection.get_project()
git_api = project.get_git_api()
repo = git_api.get_repo("my_repo")
repo.add_remote("upstream", "https://github.com/organization/repo.git")
- name
str
: name of the remote - url
str
: url of the remote
Returns
GitRemote
Raises
RestAPIError
in case the backend fails to add the remote.
Retrieval#
get_remote#
GitRepo.get_remote(name)
Get a remote by name for the repo.
Arguments
- name
str
: name of the remote
Returns
GitRemote
Raises
RestAPIError
in case the backend fails to get the remote.
get_remotes#
GitRepo.get_remotes()
Get the configured remotes for the repo.
Returns
List[GitRemote]
Raises
RestAPIError
in case the backend fails to retrieve the remotes.
Properties#
name#
Name of the remote
url#
Url of the remote
Methods#
delete#
GitRemote.delete()
Remove the git remote from the repo.
Raises
RestAPIError
.