get_git_branch

pyhelpers.ops.get_git_branch(verbose=False)[source]

Gets the current Git branch name.

Parameters:

verbose (bool | int) – Whether to print relevant information in console; defaults to False.

Returns:

The name of the currently checked-out Git branch.

Return type:

str

Examples:

>>> from pyhelpers.ops import get_git_branch
>>> get_git_branch()
'master'