Found this answer to help with gitPython and ssh keys GitPython and SSH Keys?
I want to dynamically use the latest tagged version for something, but without cloning the repo.. something like
import os
from git import Repo
from git import Git
git_ssh_identity_file = os.path.expanduser('~/.ssh/id_rsa')
git_ssh_cmd = 'ssh -i %s' % git_ssh_identity_file
with Git().custom_environment(GIT_SSH_COMMAND=git_ssh_cmd):
repo = Git('git@<cdn>')
# repo = Repo('git@<cdn>') # this doesn't work, gives a 'NoSuchPathError'
latest_tag = # how to get tags?
<do something with latest_tag>
I'm unable to find any examples and my git python knowledge is very small