Ggit.Remote

g GObject.Object GObject.Object Ggit.ObjectFactoryBase Ggit.ObjectFactoryBase GObject.Object->Ggit.ObjectFactoryBase Ggit.Native Ggit.Native Ggit.Remote Ggit.Remote Ggit.Native->Ggit.Remote Ggit.ObjectFactoryBase->Ggit.Native

Subclasses:

None

Methods

Inherited:

GObject.Object (37)

Structs:

GObject.ObjectClass (5)

class

new (repository, name, url)

class

new_anonymous (repository, url)

connect (direction, callbacks, proxy_options, custom_headers)

disconnect ()

download (specs, fetch_options)

get_connected ()

get_fetch_specs ()

get_name ()

get_owner ()

get_push_specs ()

get_url ()

list ()

prune (callbacks)

push (specs, push_options)

update_tips (callbacks, update_fetch_head, tags_type, message)

upload (specs, push_options)

Virtual Methods

Inherited:

GObject.Object (7)

Properties

Inherited:

Ggit.Native (1)

Signals

Inherited:

GObject.Object (1)

Fields

Inherited:

GObject.Object (1)

Name

Type

Access

Description

parent_instance

Ggit.Native

r

Class Details

class Ggit.Remote(**kwargs)
Bases:

Ggit.Native

Abstract:

No

Structure:

Ggit.RemoteClass

Represents a git remote.

classmethod new(repository, name, url)
Parameters:
Raises:

GLib.Error

Returns:

a newly allocated Ggit.Remote or None.

Return type:

Ggit.Remote or None

Creates a remote with the default refspecs in memory. You can use this when you have a URL instead of a remote’s name.

classmethod new_anonymous(repository, url)
Parameters:
Raises:

GLib.Error

Returns:

a newly allocated Ggit.Remote or None.

Return type:

Ggit.Remote or None

Creates a remote with the specified refspec in memory. You can use this when you have a URL instead of a remote’s name.

connect(direction, callbacks, proxy_options, custom_headers)
Parameters:
Raises:

GLib.Error

Opens a connection to a remote. The transport is selected based on the URL. The direction argument is due to a limitation of the git protocol (over TCP or SSH) which starts up a specific binary which can only do the one or the other.

disconnect()

Closes the connection to the remote and frees the underlying transport.

download(specs, fetch_options)
Parameters:
Raises:

GLib.Error

Returns:

True if successful, False otherwise.

Return type:

bool

Connect to the remote if not yet connected, negotiate with the remote about which objects are missing and download the resulting packfile and its index.

get_connected()
Returns:

True if it is connected.

Return type:

bool

Check whether self is connected.

get_fetch_specs()
Raises:

GLib.Error

Returns:

a list of fetch refspecs or None.

Return type:

[str] or None

Get the list of fetch refspecs for the given remote.

get_name()
Returns:

the name of self or None.

Return type:

str or None

Gets the remote’s name.

get_owner()
Returns:

the repository where the remote resides or None.

Return type:

Ggit.Repository or None

Gets the repository where self resides.

get_push_specs()
Raises:

GLib.Error

Returns:

a list of push refspecs or None.

Return type:

[str] or None

Get the list of push refspecs for the given remote.

get_url()
Returns:

the url of self or None.

Return type:

str or None

Gets the remote’s url.

list()
Raises:

GLib.Error

Returns:

the remote heads or None.

Return type:

[Ggit.RemoteHead] or None

Get a list of refs at the remote.

prune(callbacks)
Parameters:

callbacks (Ggit.RemoteCallbacks) – the callbacks to use for this connection.

Raises:

GLib.Error

Prune tracking refs that are no longer present on remote.

push(specs, push_options)
Parameters:
Raises:

GLib.Error

Returns:

True if successful, False otherwise.

Return type:

bool

Connect to the remote if not yet connected, negotiate with the remote about which objects are missing, create a packfile with the missing objects and send it.

update_tips(callbacks, update_fetch_head, tags_type, message)
Parameters:
  • callbacks (Ggit.RemoteCallbacks) – a Ggit.RemoteCallbacks.

  • update_fetch_head (bool) – whether to write to FETCH_HEAD. True to behave like git.

  • tags_type (Ggit.RemoteDownloadTagsType) – what the behaviour for downloading tags is for this fetch. This is ignored for push. This must be the same value passed to Ggit.Remote.download().

  • message (str or None) – reflog_message The message to insert into the reflogs. If None and fetching, the default is “fetch <name>”, where <name> is the name of the remote (or its url, for in-memory remotes). This parameter is ignored when pushing.

Raises:

GLib.Error

Returns:

True if successful, False otherwise.

Return type:

bool

Update tips to the new state.

upload(specs, push_options)
Parameters:
Raises:

GLib.Error

Returns:

True if successful, False otherwise.

Return type:

bool

Create a packfile and send it to the server