Skip to main content
Warning: You are using the test version of PyPI. This is a pre-production deployment of Warehouse. Changes made here affect the production instance of TestPyPI (testpypi.python.org).
Help us improve Python packaging - Donate today!

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.

Installation

Install Littlegit with pip:

pip install littlepip

Usage

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
print(output)
origin/HEAD -> origin/master
origin/master
Release History

Release History

This version
History Node

0.9.0.post4

History Node

0.9.0.post3

History Node

0.1.1

Download Files

Download Files

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

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
littlegit-0.9.0.post4.tar.gz (3.2 kB) Copy SHA256 Checksum SHA256 Source Apr 1, 2017

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting