Skip to main content

Use git from python, fast

Project description

fastgit

Usage

Installation

Install latest from pypi

$ pip install fastgit

How to use

In this example we run git init on a directory, add a .gitignore, and commit it.

import tempfile
def _git_init(g):
    if g.exists: return # Return early if git already initialised
    g.init(b='main')
    g.config('user.name', 'fastgit')
    g.config('user.email', 'fastgit@example.com')
    (g.d/".gitignore").mk_write("*.bak")
    g.add(".gitignore")
    g.commit(m="add .gitignore")
with tempfile.TemporaryDirectory() as td:
    g = Git(td)
    _git_init(g)
    assert 'add .gitignore' in g.last_commit
    print(g.branch('--show-current'))
main

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

fastgit-0.0.1.tar.gz (8.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

fastgit-0.0.1-py3-none-any.whl (7.8 kB view details)

Uploaded Python 3

File details

Details for the file fastgit-0.0.1.tar.gz.

File metadata

  • Download URL: fastgit-0.0.1.tar.gz
  • Upload date:
  • Size: 8.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.8

File hashes

Hashes for fastgit-0.0.1.tar.gz
Algorithm Hash digest
SHA256 a9789a64d22a90ce508edb9cc05158d3af0224227f606ec9ab369f08a0dd3f0d
MD5 272a0e5c76742435efa934d369a0f865
BLAKE2b-256 ab74bff49a746e6fc3bd3ff8755c58046bf222adb0b25f5d7fa904fefe4c1b46

See more details on using hashes here.

File details

Details for the file fastgit-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: fastgit-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 7.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.8

File hashes

Hashes for fastgit-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 555328bcf7d8887621ea7542926a115cd1722265252084be592fb4a664c21c96
MD5 74df6f1eed75b1223af8e993310701ad
BLAKE2b-256 7f680adb064156bf0b1c459e714f2da79cc21b75e666c307125e6cfe7616e1a6

See more details on using hashes here.

Supported by

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