get_current_branch

async _AsyncGit.get_current_branch(repo: str = None)str[source]

Get current active branch/tag.

Examples:

>>> g = Git()
>>> await g.get_current_branch()
'master'
>>> await g.checkout('testing', new=True)    # Create and checkout the branch 'testing'
>>> await g.get_current_branch()
'testing'
Parameters

repo (str) – Optionally specify a specific local repository path to run git within.

Return str current_branch

The name of the current checked out branch or tag