NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
PyPI · #156 most downloaded on PyPI
GitPython is a Python library used to interact with Git repositories
Last release 11 days ago
07 Sep 2026
Release timing varies
gaps range from 8 days to 9 months
Nearly every release is documented
notes for 59 of the last 60 stable releases
8 versions withdrawn
withdrawn after publishing
16 years old
115 releases · first in 2010
Switched back to using gitdb package as requirement (gitdb#59 _)
Switched back to using gitdb package as requirement (gitdb#59)
Restricted GitDB (gitdb2) version requirement to < 4
One column per quarter.
Replaced usage of deprecated unittest aliases and Logger.warn
Added support for Python 3.8
Bumped GitDB (gitdb2) version requirement to > 3
Fixed Repo.__repr__ when subclassed (#968)
Removed compatibility shims for Python < 3.4 and old mock library
Replaced usage of deprecated unittest aliases and Logger.warn
Removed old, no longer used assert methods
Replaced usage of nose assert methods with unittest
Properly signed re-release of v3.0.6 with new signature (See #980 _)
Properly signed re-release of v3.0.6 with new signature (See #980)
| Note: There was an issue that caused this version to be released to PyPI without a signature
Fixed warning for usage of environment variables for paths containing $ or % (#832, #961)
Added support for parsing Git internal date format (@<unix timestamp> <timezone offset>) (#965)
Removed Python 2 and < 3.3 compatibility shims (#979)
Fixed GitDB (gitdb2) requirement version specifier formatting in requirements.txt (#979)
see the following for details: https://github.com/gitpython-developers/gitpython/milestone/32?closed=1
see the following for details: https://github.com/gitpython-developers/gitpython/milestone/32?closed=1
see the following for details: https://github.com/gitpython-developers/gitpython/milestone/31?closed=1
see the following for details: https://github.com/gitpython-developers/gitpython/milestone/31?closed=1
see the following for (most) details: https://github.com/gitpython-developers/gitpython/milestone/30?closed=1
see the following for (most) details: https://github.com/gitpython-developers/gitpython/milestone/30?closed=1
fixes an issue with installation
fixes an issue with installation
Fix a performance regression __ which could make certain workloads 50% slower
Fix a performance regression which could make certain workloads 50% slower
Add currently_rebasing_on method on Repo, see the PR
Fix incorrect requirements.txt which could lead to broken installations, see this issue for details.
Motivation for this is a patch which improves unicode handling when dealing with filesystem paths. Python 2 compatibility was introduced to deal with
Motivation for this is a patch which improves unicode handling when dealing with filesystem paths. Python 2 compatibility was introduced to deal with differences, and I thought it would be a good idea to 'just' drop support right now, mere 5 months away from the official maintenance stop of python 2.7.
The underlying motivation clearly is my anger when thinking python and unicode, which was a hassle from the start, at least in a codebase as old as GitPython, which totally doesn't handle encodings correctly in many cases.
Having migrated to using Rust exclusively for tooling, I still see that correct handling of encodings isn't entirely trivial, but at least Rust makes clear what has to be done at compile time, allowing to write software that is pretty much guaranteed to work once it compiles.
Again, my apologies if removing Python 2 support caused inconveniences, please see release 2.1.13 which returns it.
see the following for (most) details: https://github.com/gitpython-developers/gitpython/milestone/27?closed=1
or run have a look at the difference between tags v2.1.12 and v3.0.0: https://github.com/gitpython-developers/GitPython/compare/2.1.12...3.0.0.
Fixed GitDB (gitdb2) requirement version specifier formatting in requirements.txt (Backported from #979 _)
Fixed handling of 0 when transforming kwargs into Git command arguments (Backported from #899 _)
Fixed handling of 0 when transforming kwargs into Git command arguments (Backported from #899)
My apologies for any inconvenience this may have caused. Following semver, backward incompatible changes will be introduced in a minor version.
My apologies for any inconvenience this may have caused. Following semver, backward incompatible changes will be introduced in a minor version.
Multi-value support and interface improvements for Git configuration. Thanks to A. Jesse Jiryu Davis.
Multi-value support and interface improvements for Git configuration. Thanks to A. Jesse Jiryu Davis.
or run have a look at the difference between tags v2.1.11 and v2.1.12: https://github.com/gitpython-developers/GitPython/compare/2.1.11...2.1.12
see the following for (most) details: https://github.com/gitpython-developers/gitpython/milestone/26?closed=1
see the following for (most) details: https://github.com/gitpython-developers/gitpython/milestone/26?closed=1
or run have a look at the difference between tags v2.1.10 and v2.1.11: https://github.com/gitpython-developers/GitPython/compare/2.1.10...2.1.11
see the following for (most) details: https://github.com/gitpython-developers/gitpython/milestone/25?closed=1
see the following for (most) details: https://github.com/gitpython-developers/gitpython/milestone/25?closed=1
or run have a look at the difference between tags v2.1.9 and v2.1.10: https://github.com/gitpython-developers/GitPython/compare/2.1.9...2.1.10
see the following for (most) details: https://github.com/gitpython-developers/gitpython/milestone/24?closed=1
see the following for (most) details: https://github.com/gitpython-developers/gitpython/milestone/24?closed=1
or run have a look at the difference between tags v2.1.8 and v2.1.9: https://github.com/gitpython-developers/GitPython/compare/2.1.8...2.1.9
see the following for (most) details: https://github.com/gitpython-developers/gitpython/milestone/23?closed=1
see the following for (most) details: https://github.com/gitpython-developers/gitpython/milestone/23?closed=1
or run have a look at the difference between tags v2.1.7 and v2.1.8: https://github.com/gitpython-developers/GitPython/compare/2.1.7...2.1.8
Nothing published for this version
* support for worktrees
support for worktrees
Nothing published for this version
Nothing published for this version
All issues and PRs can be viewed in all detail when following this URL: https://github.com/gitpython-developers/GitPython/milestone/21?closed=1
All issues and PRs can be viewed in all detail when following this URL: https://github.com/gitpython-developers/GitPython/milestone/21?closed=1
Nothing published for this version
All issues and PRs can be viewed in all detail when following this URL: https://github.com/gitpython-developers/GitPython/issues?q=is%3Aclosed+milesto
All issues and PRs can be viewed in all detail when following this URL: https://github.com/gitpython-developers/GitPython/issues?q=is%3Aclosed+milestone%3A%22v2.1.1+-+Bugfixes%22
Special thanks to @ankostis, who made this release possible (nearly) single-handedly. GitPython is run by its users, and their PRs make all the differ
Special thanks to @ankostis, who made this release possible (nearly) single-handedly. GitPython is run by its users, and their PRs make all the difference, they keep GitPython relevant. Thank you all so much for contributing !
The GIT_DIR environment variable does not override the path argument when initializing a Repo object anymore. However, if said path unset, GIT_DIR will be used to fill the void.
All issues and PRs can be viewed in all detail when following this URL: https://github.com/gitpython-developers/GitPython/issues?q=is%3Aclosed+milestone%3A%22v2.1.0+-+proper+windows+support%22
tag.commit will now resolve commits deeply.
tag.commit will now resolve commits deeply.
Repo objects can now be pickled, which helps with multi-processing.
Head.checkout() now deals with detached heads, which is when it will return the HEAD reference instead.
DiffIndex.iter_change_type(...) produces better results when diffing
Nothing published for this version
Nothing published for this version
DiffIndex.iter_change_type(...) produces better results when diffing an index against the working tree.
DiffIndex.iter_change_type(...) produces better results when diffing an index against the working tree.
Repo().is_dirty(...) now supports the path parameter, to specify a single path by which to filter the output. Similar to git status <path>
Symbolic refs created by this library will now be written with a newline character, which was previously missing.
blame() now properly preserves multi-line commit messages.
No longer corrupt ref-logs by writing multi-line comments into them.
IndexFile.commit(...,skip_hooks=False) added. This parameter emulates the behaviour of --no-verify on the command-line.
behaviour of --no-verify on the command-line.
Fix: remote output parser now correctly matches refs with non-ASCII chars in them
Fix: remote output parser now correctly matches refs with non-ASCII chars in them
API: Diffs now have a_rawpath, b_rawpath, raw_rename_from, raw_rename_to properties, which are the raw-bytes equivalents of their unicode path counterparts.
Fix: TypeError about passing keyword argument to string decode() on Python 2.6.
Feature: setUrl API on Remotes
Fix: parser of fetch info lines choked on some legitimate lines
Fix: parser of fetch info lines choked on some legitimate lines
Fix: parser of commit object data is now robust against cases where commit object contains invalid bytes. The invalid characters are now replaced rath
Fix: parser of commit object data is now robust against cases where commit object contains invalid bytes. The invalid characters are now replaced rather than choked on.
Fix: non-ASCII paths are now properly decoded and returned in .diff() output
Fix: RemoteProgress will now strip the ', ' prefix or suffix from messages.
API: Remote.[fetch|push|pull](...) methods now allow the progress argument to be a callable. This saves you from creating a custom type with usually just one implemented method.
Fix: bug in git-blame --incremental output parser that broken when commit messages contained \r characters
Fix: bug in git-blame --incremental output parser that broken when commit messages contained \r characters
Fix: progress handler exceptions are not caught anymore, which would usually just hide bugs previously.
Fix: The Git.execute method will now redirect stdout to devnull if with_stdout is false, which is the intended behaviour based on the parameter's documentation.
Fix: source package does not include \*.pyc files
Fix: source package does not include *.pyc files
Fix: source package does include doc sources
Fix: remote output parser now correctly matches refs with "@" in them
Fix: remote output parser now correctly matches refs with "@" in them
Please note that due to breaking changes, we have to increase the major version.
Please note that due to breaking changes, we have to increase the major version.
IMPORTANT: This release drops support for python 2.6, which is officially deprecated by the python maintainers.
CRITICAL: Diff objects created with patch output will now not carry the --- and +++ header lines anymore. All diffs now start with the @@ header line directly. Users that rely on the old behaviour can now (reliably) read this information from the a_path and b_path properties without having to parse these lines manually.
Commit now has extra properties authored_datetime and committer_datetime (to get Python datetime instances rather than timestamps)
Commit.diff() now supports diffing the root commit via Commit.diff(NULL_TREE).
Repo.blame() now respects incremental=True, supporting incremental blames. Incremental blames are slightly faster since they don't include the file's contents in them.
Fix: Diff objects created with patch output will now have their a_path and b_path properties parsed out correctly. Previously, some values may have been populated incorrectly when a file was added or deleted.
Fix: diff parsing issues with paths that contain "unsafe" chars, like spaces, tabs, backslashes, etc.
IMPORTANT: Changed default object database of Repo objects to GitCmdObjectDB. The pure-python implementation used previously usually fails to release
IMPORTANT: Changed default object database of Repo objects to GitCmdObjectDB. The pure-python implementation used previously usually fails to release its resources (i.e. file handles), which can lead to problems when working with large repositories.
CRITICAL: fixed incorrect Commit object serialization when authored or commit date had timezones which were not divisiblej by 3600 seconds. This would happen if the timezone was something like +0530 for instance.
A list of all additional fixes can be found on GitHub
CRITICAL: Tree.cache was removed without replacement. It is technically impossible to change individual trees and expect their serialization results to be consistent with what git expects. Instead, use the IndexFile facilities to adjust the content of the staging area, and write it out to the respective tree objects using IndexFile.write_tree() instead.
A list of all issues can be found on GitHub __
A list of all issues can be found on GitHub
This version is equivalent to v0.3.7, but finally acknowledges that GitPython is stable and production ready.
This version is equivalent to v0.3.7, but finally acknowledges that GitPython is stable and production ready.
It follows the semantic version scheme, and thus will not break its existing API unless it goes 2.0.
IndexFile.add() will now write the index without any extension data by default. However, you may override this behaviour with the new write_extension_
IndexFile.add() will now write the index without any extension data by default. However, you may override this behaviour with the new write_extension_data keyword argument.
Renamed ignore_tree_extension_data keyword argument in IndexFile.write(...) to ignore_extension_data
If the git command executed during Remote.push(...)|fetch(...) returns with an non-zero exit code and GitPython didn't obtain any head-information, the corresponding GitCommandError will be raised. This may break previous code which expected these operations to never raise. However, that behaviour is undesirable as it would effectively hide the fact that there was an error. See this issue for more information.
If the git executable can't be found in the PATH or at the path provided by GIT_PYTHON_GIT_EXECUTABLE, this is made obvious by throwing GitCommandNotFound, both on unix and on windows.
Those who support GUI on windows will now have to set git.Git.USE_SHELL = True to get the previous behaviour.
A list of all issues can be found on GitHub
#### Watch me making the release in an _archived development live-stream_ on youtube
DOCS
special members like __init__ are now listed in the API documentation
tutorial section was revised entirely, more advanced examples were added.
POSSIBLY BREAKING CHANGES
As rev_parse will now throw BadName as well as BadObject, client code will have to catch both exception types.
Repo.working_tree_dir now returns None if it is bare. Previously it raised AssertionError.
IndexFile.add() previously raised AssertionError when paths where used with bare repository, now it raises InvalidGitRepositoryError
Added Repo.merge_base() implementation. See the respective issue on GitHub
[include] sections in git configuration files are now respected
Added GitConfigParser.rename_section()
Added Submodule.rename()
A list of all issues can be found on GitHub
push/pull/fetch operations will not block anymore
push/pull/fetch operations will not block anymore
diff() can now properly detect renames, both in patch and raw format. Previously it only worked when create_patch was True.
repo.odb.update_cache() is now called automatically after fetch and pull operations. In case you did that in your own code, you might want to remove your line to prevent a double-update that causes unnecessary IO.
Repo(path) will not automatically search upstream anymore and find any git directory on its way up. If you need that behaviour, you can turn it back on using the new search_parent_directories=True flag when constructing a Repo object.
IndexFile.commit() now runs the pre-commit and post-commit hooks. Verified to be working on posix systems only.
A list of all fixed issues can be found here: https://github.com/gitpython-developers/GitPython/issues?q=milestone%3A%22v0.3.5+-+bugfixes%22+
Internally, hexadecimal SHA1 are treated as ascii encoded strings. Binary SHA1 are treated as bytes.
Internally, hexadecimal SHA1 are treated as ascii encoded strings. Binary SHA1 are treated as bytes.
Id attribute of Commit objects is now hexsha, instead of binsha. The latter makes no sense in python 3 and I see no application of it anyway besides its artificial usage in test cases.
IMPORTANT: If you were using the config_writer(), you implicitly relied on __del__ to work as expected to flush changes. To be sure changes are flushed under PY3, you will have to call the new release() method to trigger a flush. For some reason, __del__ is not called necessarily anymore when a symbol goes out of scope.
The Tree now has a .join('name') method which is equivalent to tree / 'name'
When fetching, pulling or pushing, and an error occurs, it will not be reported on stdout anymore. However, if there is a fatal error, it will still r
When fetching, pulling or pushing, and an error occurs, it will not be reported on stdout anymore. However, if there is a fatal error, it will still result in a GitCommandError to be thrown. This goes hand in hand with improved fetch result parsing.
Code Cleanup (in preparation for python 3 support)
Applied autopep8 and cleaned up code
Using python logging module instead of print statements to signal certain kinds of errors
* Fix for #207 _
Release of most recent version as non-RC build, just to allow pip to install the latest version right away.
Release of most recent version as non-RC build, just to allow pip to install the latest version right away.
Have a look at the milestones (https://github.com/gitpython-developers/GitPython/milestones) to see what's next.
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Your coding agent can read these notes before it upgrades. Set up the MCP server →