]> git.proxmox.com Git - libgit2.git/blame - README.md
Merge pull request #583 from tuxdna/development
[libgit2.git] / README.md
CommitLineData
4b7483a2 1libgit2 - the Git linkable library
c5b97d5a 2======================
4b7483a2
SC
3
4libgit2 is a portable, pure C implementation of the Git core methods provided as a
5re-entrant linkable library with a solid API, allowing you to write native
6speed custom Git applications in any language with bindings.
7
b760fbf5
VM
8libgit2 is licensed under a **very permissive license** (GPLv2 with a special Linking Exception).
9This basically means that you can link it (unmodified) with any kind of software without having to
10release its source code.
11
12* Mailing list: <libgit2@librelist.org>
e0d9e12e 13* Website: <http://libgit2.github.com>
e49020e0 14* API documentation: <http://libgit2.github.com/libgit2>
e0d9e12e 15* Usage guide: <http://libgit2.github.com/api.html>
4b7483a2
SC
16
17What It Can Do
18==================================
19
20libgit2 is already very usable.
c5b97d5a 21
b760fbf5 22* SHA conversions, formatting and shortening
5689a8d5 23* abstracted ODB backend system
7548b8af 24* commit, tag, tree and blob parsing, editing, and write-back
4b7483a2 25* tree traversal
b760fbf5
VM
26* revision walking
27* index file (staging area) manipulation
b760fbf5 28* reference management (including packed references)
7548b8af
VM
29* config file management
30* high level repository management
31* thread safety and reentrancy
32* descriptive and detailed error messages
33* ...and more (over 175 different API calls)
b760fbf5 34
7548b8af
VM
35Building libgit2 - Using CMake
36==============================
ec821ca6 37
bbcc7ffc 38libgit2 builds cleanly on most platforms without any external dependencies.
a07d8994 39Under Unix-like systems, like Linux, \*BSD and Mac OS X, libgit2 expects `pthreads` to be available;
bbcc7ffc
VM
40they should be installed by default on all systems. Under Windows, libgit2 uses the native Windows API
41for threading.
42
7548b8af 43The libgit2 library is built using CMake 2.6+ (<http://www.cmake.org>) on all platforms.
4b7483a2 44
e0d9e12e 45On most systems you can build the library using the following commands
4b7483a2 46
e0d9e12e
VM
47 $ mkdir build && cd build
48 $ cmake ..
49 $ cmake --build .
c5b97d5a 50
e0d9e12e
VM
51Alternatively you can point the CMake GUI tool to the CMakeLists.txt file and generate platform specific build project or IDE workspace.
52
53To install the library you can specify the install prefix by setting:
4b7483a2 54
e0d9e12e
VM
55 $ cmake .. -DCMAKE_INSTALL_PREFIX=/install/prefix
56 $ cmake --build . --target install
4b7483a2 57
5cb7a1ad
CMN
58If you want to build a universal binary for Mac OS X, CMake sets it
59all up for you if you use `-DCMAKE_OSX_ARCHITECTURES="i386;x86_64"`
60when configuring.
61
e0d9e12e 62For more advanced use or questions about CMake please read <http://www.cmake.org/Wiki/CMake_FAQ>.
c5b97d5a 63
7548b8af
VM
64The following CMake variables are declared:
65
66- `INSTALL_BIN`: Where to install binaries to.
67- `INSTALL_LIB`: Where to install libraries to.
68- `INSTALL_INC`: Where to install headers to.
f0890fcc 69- `BUILD_SHARED_LIBS`: Build libgit2 as a Shared Library (defaults to ON)
7548b8af
VM
70- `BUILD_TESTS`: Build the libgit2 test suite (defaults to ON)
71- `THREADSAFE`: Build libgit2 with threading support (defaults to OFF)
c5b97d5a 72
e0d9e12e
VM
73Language Bindings
74==================================
4b7483a2 75
e0d9e12e 76Here are the bindings to libgit2 that are currently available:
4b7483a2 77
e0d9e12e 78* Rugged (Ruby bindings) <https://github.com/libgit2/rugged>
74bcb63f 79* objective-git (Objective-C bindings) <https://github.com/libgit2/objective-git>
b760fbf5
VM
80* pygit2 (Python bindings) <https://github.com/libgit2/pygit2>
81* libgit2sharp (.NET bindings) <https://github.com/libgit2/libgit2sharp>
82* php-git (PHP bindings) <https://github.com/libgit2/php-git>
83* luagit2 (Lua bindings) <https://github.com/libgit2/luagit2>
84* GitForDelphi (Delphi bindings) <https://github.com/libgit2/GitForDelphi>
85* node-gitteh (Node.js bindings) <https://github.com/libgit2/node-gitteh>
11a203e1 86* nodegit (Node.js bindings) <https://github.com/tbranyen/nodegit>
f3cf7f6d 87* go-git (Go bindings) <https://github.com/str1ngs/go-git>
9d163937 88* libqgit2 (C++ Qt bindings) <https://projects.kde.org/projects/playground/libs/libqgit2/>
08db1efd 89* libgit2-ocaml (ocaml bindings) <https://github.com/burdges/libgit2-ocaml>
e0d9e12e 90* Geef (Erlang bindings) <https://github.com/schacon/geef>
7548b8af 91* libgit2net (.NET bindings, low level) <https://github.com/txdv/libgit2net>
d2b96cf4 92* parrot-libgit2 (Parrot Virtual Machine bindings) <https://github.com/letolabs/parrot-libgit2>
f630366f 93* hgit2 (Haskell bindings) <https://github.com/norm2782/hgit2>
20626db1 94* git-xs-pm (Perl bindings) <https://github.com/ingydotnet/git-xs-pm>
27f69e48 95* libgit2.vapi (Vala bindings) <https://github.com/apmasell/vapis/blob/master/libgit2.vapi>
13f77071 96* libgit2-glib (GObject bindings) <https://github.com/nacho/libgit2-glib>
4b7483a2
SC
97
98If you start another language binding to libgit2, please let us know so
99we can add it to the list.
100
c5b97d5a
SC
101How Can I Contribute
102==================================
103
104Fork libgit2/libgit2 on GitHub, add your improvement, push it to a branch
105in your fork named for the topic, send a pull request.
106
107You can also file bugs or feature requests under the libgit2 project on
108GitHub, or join us on the mailing list by sending an email to:
109
110libgit2@librelist.com
111
112
932d1baf 113License
4b7483a2 114==================================
e0d9e12e 115libgit2 is under GPL2 **with linking exemption**. This means you
4b7483a2
SC
116can link to the library with any program, commercial, open source or
117other. However, you cannot modify libgit2 and distribute it without
118supplying the source.
119
120See the COPYING file for the full license text.