Is the libgit2 project or does anyone else provide sample code to demonstrate the various libgit2 functions?

I use libgit2 through FFI in another language, but it’s hard for me to understand that they actually perform various functions (and I would prefer not to resort to reading the source code if it is absolutely necessary). Does anyone know where I can find some working code examples for some functions in libgit2?

+4
source share
2 answers

There are many ways to help you get started with libgit2:

  • A series of posts from Ben Straub, one of the main contributors
  • A look at libgit2 examples that are written in very easy to understand C code
  • Reading headlines that describe each function, expected parameters and produce output
  • Another angle would be to look at libgit2 tests that emphasize the behavioral contract of each function, or if you are more familiar with other languages, take a look at the test code for some libgit2 bindings and then immerse yourself in how they implement libgit2
+5
source
0
source

Source: https://habr.com/ru/post/1483037/


All Articles