API
- ygit.clone(url, directory='.', *, username=None, password=None, ref='HEAD', shallow=True, cone=None, quiet=False)
Clones a repository.
- Parameters:
url – An HTTP/S endpoint. Ex:
https://github.com/keredson/ygit.git
directory – The directory to clone into.
ref – The revision to fetch if shallow.
username – Username for HTTP authentication.
password – Password or personally access token for HTTP authentication. See: https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token
cone – Only checkout files in this subdirectory, as if they were in the root directory. Useful for if the code you want on your microcontroller is in a subdirectory of your repo.
shallow – Only download trees/blobs for specified revision (not all history).
quiet – Passed to the git server.
- ygit.Repo.checkout(self, ref='HEAD', _decomp_kill=True)
Updates your files to the revision specified.
- ygit.Repo.pull(self, shallow=True, quiet=False, ref='HEAD', _decomp_kill=True)
Performs a fetch(), and if new changes are found, a checkout().
- ygit.Repo.fetch(self, shallow=True, quiet=False, ref='HEAD', blobless=None, _decomp_kill=True)
Incrementally pulls new objects from the upstream repo.
- Parameters:
shallow – Only download trees/blobs for specified revision (not all history).
quiet – Passed to the git server.
ref – The revision to fetch if shallow.
blobless – Only pull commits/trees, not blobs. (IE download the filesystem structure, not the files themselves.)
- Returns updated:
If updates were found.
- ygit.Repo.status(self, out=<_io.TextIOWrapper name='<stdout>' mode='w' encoding='utf-8'>, ref='HEAD')
Checks the modification status of local files. Prints to stdout (or a file-like object, via the out parameter).
- ygit.Repo.tags(self)
Returns a list of known tags.
- ygit.Repo.branches(self)
Returns a list of known branches.
- ygit.Repo.pulls(self)
Returns a list of known pulls.
- ygit.Repo.update_authentication(self, username, password, url=None)
Saves a new username/password for future operations. Credentials are stored on the device, AES encrypted with the machine id as the key.
- ygit.Repo.log(self, ref='HEAD', out=<_io.TextIOWrapper name='<stdout>' mode='w' encoding='utf-8'>)
Prints to stdout (or a file-like object, via the out parameter) the git log.