Skip to content

Instantly share code, notes, and snippets.

@randomsequence
Last active December 17, 2015 17:29
Show Gist options
  • Save randomsequence/5646095 to your computer and use it in GitHub Desktop.
Save randomsequence/5646095 to your computer and use it in GitHub Desktop.
libgit2, making empty repos
const char *path = "/path/to/repo";
git_repository *r;
git_repository_init(&r, path, 0);
git_reference *git_reference;
git_reference_lookup(&git_reference, r, "HEAD");
// git_reference == NULL
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment