libgit2

git_submodule_set_url

Version:

Set the URL for the submodule.

This sets the URL in memory for the submodule. This will be used for any following submodule actions while this submodule data is in memory.

After calling this, you may wish to call git_submodule_save() to write the changes back to the ".gitmodules" file and git_submodule_sync() to write the changes to the checked out submodule repository.

Signature

int git_submodule_set_url(git_submodule *submodule, const char *url);

Parameters

In
submodule

Pointer to the submodule object

const char *
In
url

URL that should be used for the submodule

Returns

int

0 on success, < 0 on failure

Versions