git
Git source control management implementation.
Attributes¶
Classes¶
Git
¶
Git(config: SCMConfig)
Git implementation.
Methods:¶
assert_nondirty
¶
assert_nondirty() -> None
Asserts that the repository is not dirty.
| RAISES | DESCRIPTION |
|---|---|
DirtyWorkingDirectoryError
|
If the repository is not clean. |
commit_and_tag
¶
commit_and_tag(files: List[Pathlike], context: MutableMapping, dry_run: bool = False) -> None
Commit and tag files to the repository using the configuration.
Functions:¶
commit_info
¶
commit_info(config: SCMConfig) -> dict
delete_remote_tag
¶
delete_remote_tag(remote_name: str, ref_name: str) -> None
Delete ref_name from remote_name, ignoring missing remote tag errors.
has_remote
¶
has_remote(remote_name: str) -> bool
Return True if remote_name exists in the repository remotes.
moveable_tag
¶
moveable_tag(name: str) -> None
Create a new lightweight tag that should overwrite any previous tags with the same name.
| PARAMETER | DESCRIPTION |
|---|---|
name
|
The name of the moveable tag.
TYPE:
|
push_remote
¶
push_remote(remote_name: str, ref_name: str, force: bool = False) -> None
Push the ref_name to the remote_name repository, optionally forcing the push.
revision_info
¶
revision_info() -> dict
Returns a dictionary containing revision information.
If an error occurs while running the git command, the dictionary values will be set to None.
| RETURNS | DESCRIPTION |
|---|---|
dict
|
A dictionary with the following keys: - branch_name: The name of the current branch. - short_branch_name: A 20 lowercase characters of the branch name with special characters removed. - repository_root: The root directory of the Git repository. |
tag
¶
tag(name: str, sign: bool = False, message: Optional[str] = None) -> None