:param tag:
            Checks out specified tag. If set to ``None`` the latest
            tag will be checked out
        :returns:
            A list of all tags, sorted as version numbers, ascending

def tag(self):
        '''
        :param tag:
            Checks out specified tag. If set to ``None`` the latest
            tag will be checked out
        :returns:
            A list of all tags, sorted as version numbers, ascending
        '''

        tag = self.m(
            'getting git tags',
            cmdd=dict(
                cmd='git tag -l --sort="version:refname"',
                cwd=self.local
            ),
            verbose=False,
        )
        if tag.get('returncode') == 0:
            return tag.get('stdout')