找到此答案以帮助使用gitPython和ssh密钥GitPython and SSH Keys?
我想动态使用最新的标记版本,但不克隆repo。。差不多
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>
我找不到任何例子,而且我的git python知识非常有限
目前没有回答
相关问题 更多 >
编程相关推荐