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)
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.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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6771938e25ec9964e5361c664a368a4db1ceed4824ba6e24f1a21ff43b5f573c
|
|
| MD5 |
90f313f2180a028b6ed740250f8ce0a1
|
|
| BLAKE2b-256 |
d848dac2d579b809b7e48a8b478edd385f52298c9f4bb2d90428c166a110d290
|
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7af856cf0de545ccde1e3bdce11ec099b5074c75dff4ce2296d46e1db8674737
|
|
| MD5 |
7890377a38b207d3571e29f2dcb3a967
|
|
| BLAKE2b-256 |
a7dbd3d9e790d8b2fe7e231d751176d546b08785139d0744ae13dddd781cc02d
|