Skip to content

GitRemote API#

Handle#

[source]

get_git_api#

Project.get_git_api()

Get the git repository api for the project.

Returns

GitApi: The Git Api handle


Creation#

[source]

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")
Arguments

  • 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#

[source]

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.


[source]

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#

[source]

name#

Name of the remote


[source]

url#

Url of the remote


Methods#

[source]

delete#

GitRemote.delete()

Remove the git remote from the repo.

Raises

RestAPIError.