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.3.tar.gz (7.4 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.3-py3-none-any.whl (7.8 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for fastgit-0.0.3.tar.gz
Algorithm Hash digest
SHA256 972e4d9e8fa2d6eee4698c0ef2dc1a39ad692f0be12279bd311a0aee6b2f4d10
MD5 b16c249c96bea190e43bdaf8d51c0a47
BLAKE2b-256 12c877eeace67dffd8d9a120874c4e2c5358a09a9160dcdd99095849044553aa

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fastgit-0.0.3-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.0

File hashes

Hashes for fastgit-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 8685864c8076ec4f6d8ef201efd90eb905c34deae83454945fe9c04ebc62bee2
MD5 282acd09b98b6fd3cd4f8677397aef1d
BLAKE2b-256 e4707e06cd26b268e71aab5de909af78f395e78c84c1f0b133f0ef574f73dde5

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