libgit2

git_remote_rename

Version:

Give the remote a new name

All remote-tracking branches and configuration settings for the remote are updated.

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

No loaded instances of a the remote with the old name will change their name or their list of refspecs.

Signature

int git_remote_rename(git_strarray *problems, git_repository *repo, const char *name, const char *new_name);

Parameters

In
problems

non-default refspecs cannot be renamed and will be stored here for further processing by the caller. Always free this strarray on successful return.

In
repo

the repository in which to rename

const char *
In
name

the current name of the remote

const char *
In
new_name

the new name the remote should bear

Returns

int

0, GIT_EINVALIDSPEC, GIT_EEXISTS or an error code

Versions