libgit2

git_remote_connect

Version:

Open 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.

Signature

int git_remote_connect(git_remote *remote, git_direction direction, const git_remote_callbacks *callbacks, const git_strarray *custom_headers);

Parameters

In
remote

the remote to connect to

In
direction

GIT_DIRECTION_FETCH if you want to fetch or GIT_DIRECTION_PUSH if you want to push

In
callbacks

the callbacks to use for this connection

In
custom_headers

extra HTTP headers to use in this connection

Returns

int

0 or an error code

Versions