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 shutil, 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")
td = tempfile.mkdtemp()
g = Git(td)
_git_init(g)
assert 'add .gitignore' in g.last_commit
print(g.branch('--show-current'))
main
You can also pass path arguments after -- using the __ parameter:
g.log('--oneline', __=['.gitignore'])
'22a9a5d add .gitignore'
shutil.rmtree(td)
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.1.1.tar.gz
(7.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.1.1.tar.gz.
File metadata
- Download URL: fastgit-0.1.1.tar.gz
- Upload date:
- Size: 7.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.13.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cfd7f530c90698a9007266fc97cf3eea7950b2118e611ef6089618d655b20e9e
|
|
| MD5 |
9d73d414cc7a54ce98bdf0ee6bd4f37c
|
|
| BLAKE2b-256 |
60fca54df04086d5b953bbd4d5814bb88cb58d51234f8cd46c32ec8bcb6cb7b3
|
File details
Details for the file fastgit-0.1.1-py3-none-any.whl.
File metadata
- Download URL: fastgit-0.1.1-py3-none-any.whl
- Upload date:
- Size: 8.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.13.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fac4f92b360ade1530d2efb1e0a4f44f52e0bcd63021bdf269c2daca92c029f3
|
|
| MD5 |
d3017807b80a2a6dad7e18625bd53cc3
|
|
| BLAKE2b-256 |
879f49b450ca83e888d701a1605fdf731bfbb8d1a0de7dc03ad841dc597995d3
|