]> git.proxmox.com Git - libgit2.git/blob - README.md
Merge pull request #260 from nulltoken/fix/git_index_add
[libgit2.git] / README.md
1 libgit2 - the Git linkable library
2 ======================
3
4 libgit2 is a portable, pure C implementation of the Git core methods provided as a
5 re-entrant linkable library with a solid API, allowing you to write native
6 speed custom Git applications in any language with bindings.
7
8 libgit2 is licensed under a **very permissive license** (GPLv2 with a special Linking Exception).
9 This basically means that you can link it (unmodified) with any kind of software without having to
10 release its source code.
11
12 * Mailing list: <libgit2@librelist.org>
13 * Website: <http://libgit2.github.com>
14 * API documentation: <http://libgit2.github.com/libgit2/modules.html>
15 * Usage guide: <http://libgit2.github.com/api.html>
16
17 What It Can Do
18 ==================================
19
20 libgit2 is already very usable.
21
22 * SHA conversions, formatting and shortening
23 * abstracked ODB backend system
24 * commit, tag, tree and blob parsing, editing, and write-back
25 * tree traversal
26 * revision walking
27 * index file (staging area) manipulation
28 * reference management (including packed references)
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)
34
35 Building libgit2 - Using CMake
36 ==============================
37
38 libgit2 builds cleanly on most platforms without any external dependencies.
39 Under Unix-like systems, like Linux, * BSD and Mac OS X, libgit2 expects `pthreads` to be available;
40 they should be installed by default on all systems. Under Windows, libgit2 uses the native Windows API
41 for threading.
42
43 The libgit2 library is built using CMake 2.6+ (<http://www.cmake.org>) on all platforms.
44
45 On most systems you can build the library using the following commands
46
47 $ mkdir build && cd build
48 $ cmake ..
49 $ cmake --build .
50
51 Alternatively you can point the CMake GUI tool to the CMakeLists.txt file and generate platform specific build project or IDE workspace.
52
53 To install the library you can specify the install prefix by setting:
54
55 $ cmake .. -DCMAKE_INSTALL_PREFIX=/install/prefix
56 $ cmake --build . --target install
57
58 For more advanced use or questions about CMake please read <http://www.cmake.org/Wiki/CMake_FAQ>.
59
60 The following CMake variables are declared:
61
62 - `INSTALL_BIN`: Where to install binaries to.
63 - `INSTALL_LIB`: Where to install libraries to.
64 - `INSTALL_INC`: Where to install headers to.
65 - `BUILD_SHARED_LIBS`: Build libgit2 as a Shared Library (defaults to OFF)
66 - `BUILD_TESTS`: Build the libgit2 test suite (defaults to ON)
67 - `THREADSAFE`: Build libgit2 with threading support (defaults to OFF)
68
69 Language Bindings
70 ==================================
71
72 Here are the bindings to libgit2 that are currently available:
73
74 * Rugged (Ruby bindings) <https://github.com/libgit2/rugged>
75 * objective-git (Objective-C bindings) <https://github.com/libgit2/objective-git>
76 * pygit2 (Python bindings) <https://github.com/libgit2/pygit2>
77 * libgit2sharp (.NET bindings) <https://github.com/libgit2/libgit2sharp>
78 * php-git (PHP bindings) <https://github.com/libgit2/php-git>
79 * luagit2 (Lua bindings) <https://github.com/libgit2/luagit2>
80 * GitForDelphi (Delphi bindings) <https://github.com/libgit2/GitForDelphi>
81 * node-gitteh (Node.js bindings) <https://github.com/libgit2/node-gitteh>
82 * nodegit (Node.js bindings) <https://github.com/tbranyen/nodegit>
83 * go-git (Go bindings) <https://github.com/str1ngs/go-git>
84 * libqgit2 (C++ QT bindings) <https://projects.kde.org/projects/playground/libs/libqgit2/>
85 * libgit2-ocaml (ocaml bindings) <https://github.com/burdges/libgit2-ocaml>
86 * Geef (Erlang bindings) <https://github.com/schacon/geef>
87 * libgit2net (.NET bindings, low level) <https://github.com/txdv/libgit2net>
88
89 If you start another language binding to libgit2, please let us know so
90 we can add it to the list.
91
92 How Can I Contribute
93 ==================================
94
95 Fork libgit2/libgit2 on GitHub, add your improvement, push it to a branch
96 in your fork named for the topic, send a pull request.
97
98 You can also file bugs or feature requests under the libgit2 project on
99 GitHub, or join us on the mailing list by sending an email to:
100
101 libgit2@librelist.com
102
103
104 License
105 ==================================
106 libgit2 is under GPL2 **with linking exemption**. This means you
107 can link to the library with any program, commercial, open source or
108 other. However, you cannot modify libgit2 and distribute it without
109 supplying the source.
110
111 See the COPYING file for the full license text.