11

I'm not sure whether I understood the difference between git and libgit2 correctly because the repository of git is different from libgit2, I mean they are not the same.

I want to know is there any difference between these two libraries or not?

Afshin Mehrabani
  • 33,262
  • 29
  • 136
  • 201

1 Answers1

18

git is not a library, it is a command-line tool and the reference implementation for Git. libgit2 is an implementation of the Git system with a focus towards being usable inside complex applications and from many different languages.

The repositories are Git repositories, there is no difference in their format. What there might be are differences that come from tool vs library, like libgit2 not writing out sample hook files, as those are something only a particular tool would know how to deal with. Any other differences would be considered a bug.

Carlos Martín Nieto
  • 5,207
  • 1
  • 15
  • 16
  • 2
    Hey @Carlos, what if Git added a new feature or fixed a bug in the main implementation of it's CL tool. I believe that, the main tool is used to adhere to a specific implementation/standard ? is libgit2 and Git reference implementation CL, work in conjunction ? thanks. – ahmgeek Jun 24 '16 at 22:18
  • Feature are added as people need them. The git tool is the reference implementation, and it has strong backwards compatibily for plumbing commands so they don't change the outputs. – Carlos Martín Nieto Aug 08 '16 at 15:24
  • "git is a reference implementation of Git" - you have made it sound like "Git" as a concept is different than `git` command line utility. Do you have a reference to back it up? From what I have read from the original author of git, in git/git repo's `README.md`: `The name "git" was given by Linus Torvalds when he wrote the very first version. He described the tool as "the stupid content tracker" and the name as (depending on your mood)`. So git is "The `git`" as far as the authors are concern. `libgit2` and `gogit` etc. are separate projects, re-implementing git commands. – vulcan raven Nov 13 '20 at 12:19