libgit2

git_branch_set_upstream

Version:

Set the upstream configuration for a given local branch

Signature

int git_branch_set_upstream(git_reference *branch, const char *upstream_name);

Parameters

In
branch

the branch to configure

const char *
In
upstream_name

remote-tracking or local branch to set as upstream. Pass NULL to unset.

Returns

int

0 or an error code

Versions