libgit2

git_reference_create_oid

Version:

Create a new object id reference.

The reference will be created in the repository and written to the disk.

The generated reference must be freed by the user.

If force is true and there already exists a reference with the same name, it will be overwritten.

Signature

int git_reference_create_oid(git_reference **ref_out, git_repository *repo, const char *name, const git_oid *id, int force);

Parameters

In
ref_out

Pointer to the newly created reference

In
repo

Repository where that reference will live

const char *
In
name

The name of the reference

In
id

The object id pointed to by the reference.

int
In
force

Overwrite existing references

Returns

int

0 or an error code

Versions