<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def get_version_from_tag(tag_name: str) -> Optional[str]: """Get git hash from tag :param tag_name: Name of the git tag (i.e. 'v1.0.0') :return: sha1 hash of the commit """


    debug('get_version_from_tag({})'.format(tag_name))
    check_repo()
    for i in repo.tags:
        if i.name == tag_name:
            return i.commit.hexsha
    return None