Looks like you can add the [`GIT_REPOSITORY_INIT_NO_DOTGIT_DIR ` flag](https://github.com/libgit2/libgit2/blob/development/include/git2/repository.h#L185) to achieve this.