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)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
972e4d9e8fa2d6eee4698c0ef2dc1a39ad692f0be12279bd311a0aee6b2f4d10
|
|
| MD5 |
b16c249c96bea190e43bdaf8d51c0a47
|
|
| BLAKE2b-256 |
12c877eeace67dffd8d9a120874c4e2c5358a09a9160dcdd99095849044553aa
|
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8685864c8076ec4f6d8ef201efd90eb905c34deae83454945fe9c04ebc62bee2
|
|
| MD5 |
282acd09b98b6fd3cd4f8677397aef1d
|
|
| BLAKE2b-256 |
e4707e06cd26b268e71aab5de909af78f395e78c84c1f0b133f0ef574f73dde5
|