Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

GitPython create and push tags

In a python script, I try to create and push a tag to origin on a git repository. I use gitpython-1.0.2.

I an able to checkout anexisting tag but no way to find how to push a new tag to remote.

Many thanks

like image 959
Thzith Avatar asked Mar 07 '16 14:03

Thzith


1 Answers

tag = repo.create_tag(tagName, message=mesg)
repo.remote.origin.push(tag.path)

tag.name may be conflict with your local branch name, use tag.path here.

like image 120
rwenshen Avatar answered Oct 31 '22 13:10

rwenshen