Repository¶
- class neophile.repository.Repository(path: Path)¶
Bases:
object
Wrapper around a Git repository to add some convenience functions.
- Parameters
path (
str
) – Root path of the Git repository.
Methods Summary
clone_or_update
(path, url)Clone a repository or update an existing repository.
Switch back to the branch before switch_branch was called.
Switch to the neophile working branch.
update
()Update an existing checkout to its current upstream.
Methods Documentation
- classmethod clone_or_update(path: Path, url: str) Repository ¶
Clone a repository or update an existing repository.
- Parameters
path (
pathlib.Path
) – Path to where the clone should be kept (and may already exist).url (
str
) – URL of the remote repository.
- Returns
repo – Newly-created repository object.
- Return type
- restore_branch() None ¶
Switch back to the branch before switch_branch was called.
Also deletes the neophile branch to clean up.