antis81/libqgit2 — comment on commit 42be4f249045b886ff1dfec6e97e0c999b391047
File:  line 0
By ropez:

The reason there are two header files is that the one in `include/git2` is the "public" API of the library, while the one in `src` is only for internal use in libgit2. The one in `src` is probably not included where the library is installed, and you should *not* use it.

The "public" type `git_object` is defined in `types.h` as follows:

typedef struct git_object git_object

As a user of the library, this is the only definition you should see. The actual content of the struct is an implementation detail that our binding library should not see.

In C, you need to forward declare a structure like this, using `typedef`, but this is not the case in C++, where you might thing of this as equivalent to:

struct git_object;