]> git.proxmox.com Git - libgit2.git/blob - README.md
add go-git (Go bindings) to the readme
[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 * object reading (loose and packed)
24 * object writing (loose)
25 * commit, tag, tree and blob parsing and write-back
26 * tree traversal
27 * revision walking
28 * index file (staging area) manipulation
29 * custom ODB backends
30 * reference management (including packed references)
31 * ...and more
32
33
34 Building libgit2 - External dependencies
35 ========================================
36
37 libgit2 builds cleanly on most platforms without any external dependencies.
38 Under Unix-like systems, like Linux, *BSD and Mac OS X, libgit2 expects `pthreads` to be available;
39 they should be installed by default on all systems. Under Windows, libgit2 uses the native Windows API
40 for threading.
41
42 Additionally, he following libraries may be used as replacement for built-in functionality:
43
44 * LibSSL **(optional)** <http://www.openssl.org/>
45
46 libgit2 can be built using the SHA1 implementation of LibSSL-Crypto, instead of the built-in custom implementations. Performance wise, they are quite similar.
47
48 Building libgit2 - Using waf
49 ======================
50
51 Waf is a minimalist build system which only requires a Python 2.5+ interpreter to run. This is the default build system for libgit2.
52
53 To build libgit2 using waf, first configure the build system by running:
54
55 $ ./waf configure
56
57 Then build the library, either in its shared (libgit2.so) or static form (libgit2.a):
58
59 $ ./waf build-static
60 $ ./waf build-shared
61
62 You can then run the full test suite with:
63
64 $ ./waf test
65
66 And finally you can install the library with (you may need to sudo):
67
68 $ sudo ./waf install
69
70 The waf build system for libgit2 accepts the following flags:
71
72 --debug
73 build the library with debug symbols.
74 Defaults to off.
75
76 --sha1=[builtin|ppc|openssl]
77 use the builtin SHA1 functions, the optimized PPC versions
78 or the SHA1 functions from LibCrypto (OpenSSL).
79 Defaults to 'builtin'.
80
81 --msvc=[7.1|8.0|9.0|10.0]
82 Force a specific version of the MSVC compiler, if more than
83 one version is installed.
84
85 --arch=[ia64|x64|x86|x86_amd64|x86_ia64]
86 Force a specific architecture for compilers that support it.
87
88 --without-sqlite
89 Disable sqlite support.
90
91 You can run `./waf --help` to see a full list of install options and
92 targets.
93
94
95 Building libgit2 - Using CMake
96 ==============================
97
98 The libgit2 library can also be built using CMake 2.6+ (<http://www.cmake.org>) on all platforms.
99
100 On most systems you can build the library using the following commands
101
102 $ mkdir build && cd build
103 $ cmake ..
104 $ cmake --build .
105
106 Alternatively you can point the CMake GUI tool to the CMakeLists.txt file and generate platform specific build project or IDE workspace.
107
108 To install the library you can specify the install prefix by setting:
109
110 $ cmake .. -DCMAKE_INSTALL_PREFIX=/install/prefix
111 $ cmake --build . --target install
112
113 For more advanced use or questions about CMake please read <http://www.cmake.org/Wiki/CMake_FAQ>.
114
115
116 Language Bindings
117 ==================================
118
119 Here are the bindings to libgit2 that are currently available:
120
121 * Rugged (Ruby bindings) <https://github.com/libgit2/rugged>
122 * objective-git (Objective-C bindings) <https://github.com/libgit2/objective-git>
123 * pygit2 (Python bindings) <https://github.com/libgit2/pygit2>
124 * libgit2sharp (.NET bindings) <https://github.com/libgit2/libgit2sharp>
125 * php-git (PHP bindings) <https://github.com/libgit2/php-git>
126 * luagit2 (Lua bindings) <https://github.com/libgit2/luagit2>
127 * GitForDelphi (Delphi bindings) <https://github.com/libgit2/GitForDelphi>
128 * node-gitteh (Node.js bindings) <https://github.com/libgit2/node-gitteh>
129 * nodegit (Node.js bindings) <https://github.com/tbranyen/nodegit>
130 * go-git (Go bindings) <https://github.com/str1ngs/go-git>
131 * libqgit2 (C++ QT bindings) <https://projects.kde.org/projects/playground/libs/libqgit2/>
132 * libgit2-ocaml (ocaml bindings) <https://github.com/burdges/libgit2-ocaml>
133 * Geef (Erlang bindings) <https://github.com/schacon/geef>
134
135 If you start another language binding to libgit2, please let us know so
136 we can add it to the list.
137
138 How Can I Contribute
139 ==================================
140
141 Fork libgit2/libgit2 on GitHub, add your improvement, push it to a branch
142 in your fork named for the topic, send a pull request.
143
144 You can also file bugs or feature requests under the libgit2 project on
145 GitHub, or join us on the mailing list by sending an email to:
146
147 libgit2@librelist.com
148
149
150 License
151 ==================================
152 libgit2 is under GPL2 **with linking exemption**. This means you
153 can link to the library with any program, commercial, open source or
154 other. However, you cannot modify libgit2 and distribute it without
155 supplying the source.
156
157 See the COPYING file for the full license text.