GitPython creates and clicks tags

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

+5
source share
3 answers
new_tag = repo.create_tag(tag, message='Automatic tag "{0}"'.format(tag)) 

repo.remotes.origin.push(new_tag)
+8
source

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")
+1
source

obj.REMOTES.origin.push ("tag")

0
source

All Articles