◐ Shell
clean mode source ↗

Add lightweight tag to specific annotated tag use GitPython API · gitpython-developers/GitPython · Discussion #1942

I still have a question. I need to add a lightweight tag to the annotated tag using the Git python API.
repo.create_tag () adds an annotated tag, not lightweight.
do something like:

repo.git.checkout(annotated_tag)
repo.git.tag(new_lightweight_tag)
repo.remotes.origin.push(new_lightweight_tag)

causes Aborting... when executing git checkout if some local changes are not saved
Is there any other way to use the Git Python API to create lightweight tag to specific annotated tag?

found similar question without answer https://stackoverflow.com/questions/58628666/gitpython-creating-a-lightweight-tag
Thanks