get_current_tag

async _AsyncGit.get_current_tag(version: str = None, repo: str = None)str[source]

Get the latest tag on this branch - useful for detecting current version of your python application.

Examples:

>>> g = Git()
>>> await g.get_current_tag()          # Get the latest tag on the active branch
'2.5.0'
>>> await g.get_current_tag('develop') # Get the latest tag on the branch 'develop'
'2.5.3'
Parameters
  • version (str) – Optionally specify a branch / tag to get the latest tag for.

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

Return str current_tag

The name of the latest tag on this branch.