libgit2

git_remote_create_inmemory

Version:

Create a remote in memory

Create a remote with the given refspec in memory. You can use this when you have a URL instead of a remote's name. Note that in-memory remotes cannot be converted to persisted remotes.

The name, when provided, will be checked for validity. See git_tag_create() for rules about valid names.

Signature

int git_remote_create_inmemory(git_remote **out, git_repository *repo, const char *fetch, const char *url);

Parameters

In
out

pointer to the new remote object

In
repo

the associated repository

const char *
In
fetch

the fetch refspec to use for this remote. May be NULL for defaults.

const char *
In
url

the remote repository's URL

Returns

int

0 or an error code

Versions