libgit2

git_remote_create_anonymous

Version:

Create an anonymous remote

Create a remote with the given url and refspec in memory. You can use this when you have a URL instead of a remote's name. Note that anonymous 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_anonymous(git_remote **out, git_repository *repo, const char *url, const char *fetch);

Parameters

In
out

pointer to the new remote object

In
repo

the associated repository

const char *
In
url

the remote repository's URL

const char *
In
fetch

the fetch refspec to use for this remote.

Returns

int

0 or an error code

Versions