In a python script, I am trying to create and push the tag to the beginning in the git repository. I am using gitpython-1.0.2.
I can check the existing tag, but I cannot find a way to reassign the new tag to the remote one.
Many thanks
new_tag = repo.create_tag(tag, message='Automatic tag "{0}"'.format(tag)) repo.remotes.origin.push(new_tag)
To create a new tag using gitpython:
from git import Repo obj = Repo("directory_name") obj.create_tag("tag_name")
To click on remote
obj.remote.origin.push("tagname")
obj.REMOTES.origin.push ("tag")