libgit2

git_remote_fetch

Version:

Download new data and update tips.

Convenience function to connect to a remote, download the data, disconnect and update the remote-tracking branches.

If options are specified and this remote is already connected then the existing remote connection options will be discarded and the remote will now use the new options.

Signature

int git_remote_fetch(git_remote *remote, const git_strarray *refspecs, const git_fetch_options *opts, const char *reflog_message);

Parameters

In
remote

the remote to fetch from

In
refspecs

the refspecs to use for this fetch. Pass NULL or an empty array to use the base refspecs.

In
opts

options to use for this fetch or NULL

const char *
In
reflog_message

The message to insert into the reflogs. If NULL, the default is "fetch"

Returns

int

0 or an error code

Versions