Skip to content
Pure-Python Git implementation
Python C Other
Branch: master
Clone or download

Latest commit

Latest commit 200fcb0 May 28, 2020


Type Name Latest commit message Commit time
Failed to load latest commit information.
.github/workflows Fix GitHub actions on Windows and Mac OSX . (#767) May 23, 2020
bin Switch binaries over to using python3. May 26, 2020
devscripts Add script for updating preamble. Sep 17, 2016
docs Disable PDF building. Oct 29, 2019
dulwich Add typing. May 29, 2020
examples Add example for using memoryrepo. Jun 3, 2018
.coveragerc Set source in coveragerc rather than passing on command-line. May 7, 2018
.gitignore Ignore .mypy_cache/. May 22, 2020
.mailmap Update mailmap. Mar 17, 2018
.testr.conf testr: Allow id list files (fixes parallel runs). Dec 19, 2010
.travis.yml Attempt to add back Python 3.5 support. May 23, 2020
AUTHORS Support passing repo as a Repo object to porcelain.clean. Mar 4, 2019
CONTRIBUTING.rst Add note about pathlib.Path. May 23, 2020
COPYING As agreed by all contributors, change the license from: Aug 7, 2016 More md => rst. Nov 18, 2018
Makefile Merge branch 'actions' May 22, 2020
NEWS Only return files from the loose store that look like git objects May 28, 2020
README.rst Add pointer to 0.19 branch in README. May 22, 2020
README.swift.rst More md => rst. Nov 18, 2018
TODO Update TODO. Jan 7, 2018
appveyor.yml Attempt to add back Python 3.5 support. May 23, 2020
build.cmd Attempt to fix 64 bit builds on Windows. May 1, 2017
dulwich.cfg Change homepage to Jul 27, 2015
requirements.txt Require urllib>=1.23, because of CVE-2018-20060 Dec 24, 2018
setup.cfg Enable type checking. May 22, 2020 Attempt to add back Python 3.5 support. May 23, 2020
tox.ini Drop support for Python 2. May 22, 2020


Build Status Windows Build Status

This is the Dulwich project.

It aims to provide an interface to git repos (both local and remote) that doesn't call out to git directly but instead uses pure Python.

Main website: <>

License: Apache License, version 2 or GNU General Public License, version 2 or later.

The project is named after the part of London that Mr. and Mrs. Git live in in the particular Monty Python sketch.


By default, Dulwich' will attempt to build and install the optional C extensions. The reason for this is that they significantly improve the performance since some low-level operations that are executed often are much slower in CPython.

If you don't want to install the C bindings, specify the --pure argument to

$ python --pure install

or if you are installing from pip:

$ pip install dulwich --global-option="--pure"

Note that you can also specify --global-option in a requirements.txt file, e.g. like this:

dulwich --global-option=--pure

Getting started

Dulwich comes with both a lower-level API and higher-level plumbing ("porcelain").

For example, to use the lower level API to access the commit message of the last commit:

>>> from dulwich.repo import Repo
>>> r = Repo('.')
>>> r.head()
>>> c = r[r.head()]
>>> c
<Commit 015fc1267258458901a94d228e39f0a378370466>
>>> c.message
'Add note about encoding.\n'

And to print it using porcelain:

>>> from dulwich import porcelain
>>> porcelain.log('.', max_entries=1)
commit: 57fbe010446356833a6ad1600059d80b1e731e15
Author: Jelmer Vernooij <>
Date:   Sat Apr 29 2017 23:57:34 +0000

Add note about encoding.

Further documentation

The dulwich documentation can be found in docs/ and built by running make doc. It can also be found on the web.


There is a #dulwich IRC channel on the Freenode, and dulwich-announce and dulwich-discuss mailing lists.


For a full list of contributors, see the git logs or AUTHORS.

If you'd like to contribute to Dulwich, see the CONTRIBUTING file and list of open issues.

Supported versions of Python

At the moment, Dulwich supports (and is tested on) CPython 3.5, 3.6, 3.7, 3.8 and Pypy.

The latest release series to support Python 2.x was the 0.19 series. See the 0.19 branch in the Dulwich git repository.

You can’t perform that action at this time.