Metadata-Version: 2.4
Name: fastgit
Version: 0.0.3
Summary: Use git from python, fast
Author-email: Jeremy Howard <github@jhoward.fastmail.fm>
License: Apache-2.0
Project-URL: Repository, https://github.com/AnswerDotAI/fastgit
Project-URL: Documentation, https://AnswerDotAI.github.io/fastgit
Keywords: nbdev,jupyter,notebook,python
Classifier: Natural Language :: English
Classifier: Intended Audience :: Developers
Classifier: Development Status :: 3 - Alpha
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Dynamic: license-file

# fastgit


<!-- WARNING: THIS FILE WAS AUTOGENERATED! DO NOT EDIT! -->

## Usage

### Installation

Install latest from [pypi](https://pypi.org/project/fastgit/)

``` sh
$ pip install fastgit
```

### How to use

In this example we run `git init` on a directory, add a *.gitignore*,
and commit it.

``` python
import tempfile
```

``` python
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")
```

``` python
with tempfile.TemporaryDirectory() as td:
    g = Git(td)
    _git_init(g)
    assert 'add .gitignore' in g.last_commit
    print(g.branch('--show-current'))
```

    main
