Skip to main content

Python commodity wrapper around GitPython

Project description


pypi tests Documentation Status

Python wrapper around GitPython

  • Free software: MIT license


This library only supports python 3. Some features may still work with python 2.7 but not all of the syntax and features may be compatible.


git_wrapper supports both standard python virtual environment setups and pipenv, which is integrated into our Makefile. To set up a pipenv-based development enironment, you can simply run:

make dev

This will install our dev environment for the package via pipenv. It is installed with --user, so it does not affect your site-packages. Pipenv creates a unique virtualenv for us, which you can activate via:

pipenv shell

See the pipenv documentation for more detail.


To build the documentation on your checkout, simply run:

make docs


If you wish to build a local package for testing at any time, you can simply run:

make dist

this will build a package with a .dev extension that you can install for testing and verification.


All new code should include tests that exercise the code and prove that it works, or fixes the bug you are trying to fix. Any Pull Request without tests will not be accepted. See CONTRIBUTING.rst for more details.

Pushing a new release

  1. Tag the commit that will be the new release and push the new tag to the repo.
  2. Github Actions will then automatically build and publish a new release with updated documentation.


All notable changes to this project will be documented in this file.

The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.


0.2.10 - 2022-09-30


  • Add function to convert a commit reference to a commit hexsha.

0.2.9 - 2022-06-30


  • Added Prune Functionality To Fetch.
  • Added Information About Integration Tests To Docs.
  • Update mergify config to use queue instead of merge.
  • Fixes for publish job.
  • Update documentation to support new 'autochangelog' setup.
  • Initial automation of changelog generation.
  • Commit_format should be an internal-only method.
  • Remove dangling reference to Python 2.7, no longer supported.
  • Replace %s string substitutions with f-strings.
  • Switch to f-string over .format method.
  • Limit to run only on master.
  • Remove python 2-specific code.
  • Use tox for make test target.
  • Change fetch-depth to get correct tag info for builds.
  • Change how we generate version for test pypi builds.
  • Fix deploy job.
  • Improvements to publish github action.
  • Fix typo in readme.
  • Revamp our build process to be more in line with our other projects.

0.2.8 - 2021-07-29


  • Prep for version 0.2.8 release.
  • Add publish action.
  • Tweaks to workflow.
  • Modify to allow tag listing.
  • [#GH-75] Create GitHub Action CI job for twine check.
  • Mergify update (#81).

0.2.7 - 2021-04-28


  • Prepare 0.2.7 release.
  • Ensure apply_diff also includes new files when committing changes.
  • Fix branch names in github action (#79).
  • Use Github Actions to run the tests and remove Travis (#78).

0.2.6 - 2021-02-11


  • Prepare 0.2.6 release.
  • Provide new helper related to the log.
  • Move property initialisation to init.

0.2.5 - 2021-01-12


  • Preps for 0.2.5 release. - 2021-01-11


  • Update version to
  • Fix RST formatting error preventing uploads to Pypi.

0.2.4 - 2021-01-11


  • Prep for 0.2.4 release.
  • Add function to grep logs (#71).
  • Add function to cherry-pick a commit.
  • Preserve square brackets in commit messages when applying patches.

0.2.3 - 2020-12-15


  • Prep for 0.2.3 release.
  • Add option to checkout newly created branches.
  • Add option to run the integration tests with podman.
  • Update README with new release instructions.

0.2.2 - 2020-07-20


  • Prepare 0.2.2 release.
  • New function to check if a commit exists on a given remote branch.

0.2.1 - 2019-04-16


  • Prep for version 0.2.1 release.
  • Add tagging functions.
  • Add function to compare commit references.
  • Check reference exists in commit.describe.
  • Update travis url so mergify works.
  • Update mergify config for v2 api.

0.2.0 - 2019-01-18


  • Prep for version 0.2.0 release.
  • Add convenience method for creating a branch.
  • Add convenience method for checking if a branch exists.
  • Fix broken doc string.
  • Add functionality to refresh a repository's remotes.
  • Add --bare cloning option.
  • Add log diff functionality.
  • Allow customised commit message for reverts.
  • Integration tests for some GitCommit/GitBranch functions.
  • Improve a few doc strings.
  • Removing python 3.5 tests.
  • Add a couple of examples to the usage doc.
  • Move describe to GitCommit.
  • Move apply and reverse functions to GitBranch.
  • Rename GitWrapperCommit into GitCommit.
  • Move cherry functions into GitBranch.
  • Move rebase functionality into GitBranch.
  • Move clone functionality into base GitRepo.
  • Move Remote functions into their own class.
  • GitWrapperBase becomes GitRepo.
  • Logging setup improvements.
  • Minor string formatting improvements.
  • Add functionality to destroy a repo and reclone it.
  • Add git clone support.
  • Add Tox & Travis support for py37.
  • Skeleton code for integration tests.
  • Add back support for Python 2.7.
  • Add support for applying a diff.
  • Add support for applying a patch.
  • Add support for basic committing and commit revert.
  • Refactor branch/hash checks into a decorator.
  • Fix rebasing on branch issue.
  • Adding contributors.
  • Drop py34 from Travis environments.
  • Move setup to use pbr.
  • Add coverage in tests reports.
  • Avoid sending git CommandError back to the user.
  • Unify 'mock' imports.
  • Drop py34.
  • Add basic logging in more places.
  • Fix several doc strings formatting.
  • Fixing readthedocs not generating api information.
  • Add support for basic rebase + abort.
  • Fix a couple of typos.
  • Fixing inconsistent quote marks in doc strings.
  • Removing the Travis CI python2.7 config.
  • Removing python 2 support.
  • Adding the wrapt dependency to simplify the Python 2 code for the.
  • Signature() is Python 3.5 only. inspect.getcallargs() doesn't.

0.1.0 - 2018-07-05


  • Preping of tag 0.1.0.
  • Fixing mergify config file whitespace (#12).
  • Correcting the HISTORY.rst file.
  • Adding a mergify config (#10).
  • Moving away from pipenv. (#5).
  • Fixing tox.ini flake8 for tests.
  • Merge pull request #6 from jpichon/fix-make-lint.
  • 'Make lint' should match the tox setup.
  • Adding GitWrapperCherry (#4).

0.0.1 - 2018-06-20


  • Adding a wrapper base class and unit tests. (#3).
  • Fixing travis-ci badge. (#2).
  • Initial project structure (#1).
  • Initial commit of README.rst.

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

git_wrapper-0.2.10.tar.gz (42.4 kB view hashes)

Uploaded Source

Built Distribution

git_wrapper-0.2.10-py3-none-any.whl (37.9 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page