1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Overview / Install — GitPython 2.0.9dev0 documentation</title>
<link rel="stylesheet" href="_static/default.css" type="text/css" />
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: './',
VERSION: '2.0.9dev0',
COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html',
HAS_SOURCE: true
};
</script>
<script type="text/javascript" src="_static/jquery.js"></script>
<script type="text/javascript" src="_static/underscore.js"></script>
<script type="text/javascript" src="_static/doctools.js"></script>
<link rel="top" title="GitPython 2.0.9dev0 documentation" href="index.html" />
<link rel="next" title="GitPython Tutorial" href="tutorial.html" />
<link rel="prev" title="GitPython Documentation" href="index.html" />
<meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9" />
</head>
<body role="document">
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body" role="main">
<div class="section" id="overview-install">
<span id="intro-toplevel"></span><h1>Overview / Install<a class="headerlink" href="#overview-install" title="Permalink to this headline">¶</a></h1>
<p>GitPython is a python library used to interact with git repositories, high-level like git-porcelain, or low-level like git-plumbing.</p>
<p>It provides abstractions of git objects for easy access of repository data, and additionally allows you to access the git repository more directly using either a pure python implementation, or the faster, but more resource intensive git command implementation.</p>
<p>The object database implementation is optimized for handling large quantities of objects and large datasets, which is achieved by using low-level structures and data streaming.</p>
<div class="section" id="requirements">
<h2>Requirements<a class="headerlink" href="#requirements" title="Permalink to this headline">¶</a></h2>
<ul>
<li><dl class="first docutils">
<dt><a class="reference external" href="https://www.python.org">Python</a> 2.7 or newer</dt>
<dd><p class="first last">Since GitPython 2.0.0. Please note that python 2.6 is still reasonably well supported, but might
deteriorate over time. Support is provided on a best-effort basis only.</p>
</dd>
</dl>
</li>
<li><dl class="first docutils">
<dt><a class="reference external" href="https://git-scm.com/">Git</a> 1.7.0 or newer</dt>
<dd><p class="first last">It should also work with older versions, but it may be that some operations
involving remotes will not work as expected.</p>
</dd>
</dl>
</li>
<li><p class="first"><a class="reference external" href="https://pypi.python.org/pypi/gitdb">GitDB</a> - a pure python git database implementation</p>
</li>
<li><p class="first"><a class="reference external" href="https://nose.readthedocs.io/en/latest/">Python Nose</a> - used for running the tests</p>
</li>
<li><p class="first"><a class="reference external" href="http://www.voidspace.org.uk/python/mock.html">Mock by Michael Foord</a> used for tests. Requires version 0.5</p>
</li>
</ul>
</div>
<div class="section" id="installing-gitpython">
<h2>Installing GitPython<a class="headerlink" href="#installing-gitpython" title="Permalink to this headline">¶</a></h2>
<p>Installing GitPython is easily done using
<a class="reference external" href="https://pip.pypa.io/en/latest/installing.html">pip</a>. Assuming it is
installed, just run the following from the command-line:</p>
<div class="highlight-none"><div class="highlight"><pre><span></span># pip install gitpython
</pre></div>
</div>
<p>This command will download the latest version of GitPython from the
<a class="reference external" href="http://pypi.python.org/pypi/GitPython">Python Package Index</a> and install it
to your system. More information about <code class="docutils literal"><span class="pre">pip</span></code> and pypi can be found
here:</p>
<ul class="simple">
<li><a class="reference external" href="https://pip.pypa.io/en/latest/installing.html">install pip</a></li>
<li><a class="reference external" href="https://pypi.python.org/pypi/GitPython">pypi</a></li>
</ul>
<p>Alternatively, you can install from the distribution using the <code class="docutils literal"><span class="pre">setup.py</span></code>
script:</p>
<div class="highlight-none"><div class="highlight"><pre><span></span># python setup.py install
</pre></div>
</div>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">In this case, you have to manually install <a class="reference external" href="https://pypi.python.org/pypi/gitdb">GitDB</a> as well. It would be recommended to use the <a class="reference internal" href="#source-code-label"><span class="std std-ref">git source repository</span></a> in that case.</p>
</div>
</div>
<div class="section" id="limitations">
<h2>Limitations<a class="headerlink" href="#limitations" title="Permalink to this headline">¶</a></h2>
<div class="section" id="leakage-of-system-resources">
<h3>Leakage of System Resources<a class="headerlink" href="#leakage-of-system-resources" title="Permalink to this headline">¶</a></h3>
<p>GitPython is not suited for long-running processes (like daemons) as it tends to
leak system resources. It was written in a time where destructors (as implemented
in the <cite>__del__</cite> method) still ran deterministically.</p>
<p>In case you still want to use it in such a context, you will want to search the
codebase for <cite>__del__</cite> implementations and call these yourself when you see fit.</p>
<p>Another way assure proper cleanup of resources is to factor out GitPython into a
separate process which can be dropped periodically.</p>
</div>
<div class="section" id="best-effort-for-python-2-6-and-windows-support">
<h3>Best-effort for Python 2.6 and Windows support<a class="headerlink" href="#best-effort-for-python-2-6-and-windows-support" title="Permalink to this headline">¶</a></h3>
<p>This means that support for these platforms is likely to worsen over time
as they are kept alive solely by their users, or not.</p>
</div>
</div>
<div class="section" id="getting-started">
<h2>Getting Started<a class="headerlink" href="#getting-started" title="Permalink to this headline">¶</a></h2>
<ul class="simple">
<li><a class="reference internal" href="tutorial.html#tutorial-label"><span class="std std-ref">GitPython Tutorial</span></a> - This tutorial provides a walk-through of some of
the basic functionality and concepts used in GitPython. It, however, is not
exhaustive so you are encouraged to spend some time in the
<a class="reference internal" href="reference.html#api-reference-toplevel"><span class="std std-ref">API Reference</span></a>.</li>
</ul>
</div>
<div class="section" id="api-reference">
<h2>API Reference<a class="headerlink" href="#api-reference" title="Permalink to this headline">¶</a></h2>
<p>An organized section of the GitPthon API is at <a class="reference internal" href="reference.html#api-reference-toplevel"><span class="std std-ref">API Reference</span></a>.</p>
</div>
<div class="section" id="source-code">
<span id="source-code-label"></span><h2>Source Code<a class="headerlink" href="#source-code" title="Permalink to this headline">¶</a></h2>
<p>GitPython’s git repo is available on GitHub, which can be browsed at:</p>
<blockquote>
<div><ul class="simple">
<li><a class="reference external" href="https://github.com/gitpython-developers/GitPython">https://github.com/gitpython-developers/GitPython</a></li>
</ul>
</div></blockquote>
<p>and cloned using:</p>
<div class="highlight-default"><div class="highlight"><pre><span></span>$ git clone https://github.com/gitpython-developers/GitPython git-python
</pre></div>
</div>
<p>Initialize all submodules to obtain the required dependencies with:</p>
<div class="highlight-default"><div class="highlight"><pre><span></span>$ cd git-python
$ git submodule update --init --recursive
</pre></div>
</div>
<p>Finally verify the installation by running the <a class="reference external" href="http://code.google.com/p/python-nose/">nose powered</a> unit tests:</p>
<div class="highlight-default"><div class="highlight"><pre><span></span>$ nosetests
</pre></div>
</div>
</div>
<div class="section" id="questions-and-answers">
<h2>Questions and Answers<a class="headerlink" href="#questions-and-answers" title="Permalink to this headline">¶</a></h2>
<p>Please use stackoverflow for questions, and don’t forget to tag it with <cite>gitpython</cite> to assure the right people see the question in a timely manner.</p>
<p><a class="reference external" href="http://stackoverflow.com/questions/tagged/gitpython">http://stackoverflow.com/questions/tagged/gitpython</a></p>
</div>
<div class="section" id="issue-tracker">
<h2>Issue Tracker<a class="headerlink" href="#issue-tracker" title="Permalink to this headline">¶</a></h2>
<p>The issue tracker is hosted by github:</p>
<p><a class="reference external" href="https://github.com/gitpython-developers/GitPython/issues">https://github.com/gitpython-developers/GitPython/issues</a></p>
</div>
<div class="section" id="license-information">
<h2>License Information<a class="headerlink" href="#license-information" title="Permalink to this headline">¶</a></h2>
<p>GitPython is licensed under the New BSD License. See the LICENSE file for
more information.</p>
</div>
</div>
</div>
</div>
</div>
<div class="sphinxsidebar" role="navigation" aria-label="main navigation">
<div class="sphinxsidebarwrapper">
<h3><a href="index.html">Table Of Contents</a></h3>
<ul>
<li><a class="reference internal" href="#">Overview / Install</a><ul>
<li><a class="reference internal" href="#requirements">Requirements</a></li>
<li><a class="reference internal" href="#installing-gitpython">Installing GitPython</a></li>
<li><a class="reference internal" href="#limitations">Limitations</a><ul>
<li><a class="reference internal" href="#leakage-of-system-resources">Leakage of System Resources</a></li>
<li><a class="reference internal" href="#best-effort-for-python-2-6-and-windows-support">Best-effort for Python 2.6 and Windows support</a></li>
</ul>
</li>
<li><a class="reference internal" href="#getting-started">Getting Started</a></li>
<li><a class="reference internal" href="#api-reference">API Reference</a></li>
<li><a class="reference internal" href="#source-code">Source Code</a></li>
<li><a class="reference internal" href="#questions-and-answers">Questions and Answers</a></li>
<li><a class="reference internal" href="#issue-tracker">Issue Tracker</a></li>
<li><a class="reference internal" href="#license-information">License Information</a></li>
</ul>
</li>
</ul>
<div class="relations">
<h3>Related Topics</h3>
<ul>
<li><a href="index.html">Documentation overview</a><ul>
<li>Previous: <a href="index.html" title="previous chapter">GitPython Documentation</a></li>
<li>Next: <a href="tutorial.html" title="next chapter">GitPython Tutorial</a></li>
</ul></li>
</ul>
</div>
<div role="note" aria-label="source link">
<h3>This Page</h3>
<ul class="this-page-menu">
<li><a href="_sources/intro.txt"
rel="nofollow">Show Source</a></li>
</ul>
</div>
<div id="searchbox" style="display: none" role="search">
<h3>Quick search</h3>
<form class="search" action="search.html" method="get">
<input type="text" name="q" />
<input type="submit" value="Go" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
</div>
</div>
<div class="clearer"></div>
</div>
<div class="footer">
©Copyright (C) 2008, 2009 Michael Trier and contributors, 2010-2015 Sebastian Thiel.
|
Powered by <a href="http://sphinx-doc.org/">Sphinx 1.4.1</a>
& <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.7</a>
|
<a href="_sources/intro.txt"
rel="nofollow">Page source</a>
</div>
</body>
</html>
|