Skip to main content

This is a little tiny wrapper around Git CLI

Project description

A very little Python wrapper around Git CLI.

Littlegit doesn’t need any external dependency except for the Git binary to be installed in your system.

All the current, past and future commands and options of Git are fully supported.


Install Littlegit with pip:

pip install littlepip


To use Littlegit is very simple, it follows a very simple rule to map Git’s commands to Littlegit’s API:

  • every Git command is a method
  • every argument is a method’s argument
  • every option is a method’s keywords

Lets explain this with an example of initialising a local repository, adding a file and commiting:

repo = Git("/my/local/repo")
repo.init()  # git init /my/local/repo

open("myfile", "w").close()

repo.add("myfile")  # git add myfile
repo.commit(message="this is my first commit")  # git commit --message "this is my first commit"
repo.remote("add", "origin", "<my_remote_repo>")  # git remote add origin <my_remote_repo>
repo.push("origin", "master")  # git push origin master

All the methods return the output if the Git command:

output = repo.branch(remote=True)  # git branch --remote
origin/HEAD -> origin/master


To run the unit tests install the development dependencies and then run Tox:

pip install -r requirements-dev.txt

Project details

Download files

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

Files for littlegit, version 0.1.1
Filename, size File type Python version Upload date Hashes
Filename, size littlegit-0.1.1.tar.gz (3.3 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page