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.2.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.2-py3-none-any.whl (7.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: fastgit-0.0.2.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.2.tar.gz
Algorithm Hash digest
SHA256 6771938e25ec9964e5361c664a368a4db1ceed4824ba6e24f1a21ff43b5f573c
MD5 90f313f2180a028b6ed740250f8ce0a1
BLAKE2b-256 d848dac2d579b809b7e48a8b478edd385f52298c9f4bb2d90428c166a110d290

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fastgit-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 7.9 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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 7af856cf0de545ccde1e3bdce11ec099b5074c75dff4ce2296d46e1db8674737
MD5 7890377a38b207d3571e29f2dcb3a967
BLAKE2b-256 a7dbd3d9e790d8b2fe7e231d751176d546b08785139d0744ae13dddd781cc02d

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