Some time ago I started contributing to a new open source project. It’s called libqgit2.
I’m working on an exciting project where we are currently creating a tool for multiple people to work on some content and share their changes with others effectively. Behind the scenes the application uses git but the user of the application should be completely unaware of this fact. That means that the application is controlling how git is actually used.
The application uses libgit2 and libqgit2 (which is a Qt wrapper for libgit2). The libgit2 is a C library that realizes the git protocol. It’s still very young and the API can’t be considered stable but it does have a pretty wide range of features it supports from the git world and it’s advancing with a nice pace. As far as I understand it’s also the only option if one wants to have a shared library for git.
The libqgit2 project doesn’t have the pulse of libgit2 as there are only a handful of contributors that have ever shipped code there and currently there isn’t too much activity going on. Since it seemed that libqgit2 was missing some pretty fundamental parts we decided that we should enhance it.
There are already some pretty good features that I have added to libqgit2, like SSH transport and support for pushes (which was missing, weirdly enough). More features will be added as our application matures and we’ll know what functionality we need from libqgit2.
5 replies on “libqgit2: use git from your Qt code”
Did you know any open source project using it ?
Is that compatible with qt5 ? I ve tryed quickly to open .pro and compile, got error : no rule to make target ‘qgitblob.cpp’, needed by ‘qgitblob.o’. Stop.
I don’t know any projects using libqgit2. I haven’t seen any interest around it – I haven’t been really looking either, though.
It’s compatible (as in it compiles) with both qt4 and qt5.
I hadn’t even realized there’s a .pro file…don’t use it 🙂 In other words CMake should be used for building, that’s the uptodate build system.
Thx, I ll try tomorrow with cmake.
The purpose is to use it inside an application for my BlackBerry :p
Hi there. Is it possible to find some examples of libqgit2 functionality usage? I mean that there is no any docs, and I dont know, how I can use libqgit2. What if I want to check, is my local version of repo is up to date? How I must use all of those classes? And I will be grateful, if you check this my question in stackoverflow. https://stackoverflow.com/questions/49678639/why-does-the-qt-application-with-libqgit2-crash-in-debug-mode
There aren’t really any examples as you’ve noticed. You can maybe learn something by checking the tests (under the tests directory in the source). The code (.h files) also has some code comments containing documentation. Libqgit2 however is mostly just a thin wrapper around libgit2, so what applies to libgit2, often applies to liqgit2 as well. And in order to use either library you need to know Git itself quite thoroughly.