<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def git_tag(tag_name, push=False):
 """ Tag the repo using an annotated tag. """

    with chdir(get_root()):
        result = run_command('git tag -a {} -m "{}"'.format(tag_name, tag_name), capture=True)

        if push:
            if result.code != 0:
                return result
            return run_command('git push origin {}'.format(tag_name), capture=True)

        return result