从URL获取最新的仓库代码

问题描述

找到了这个答案来帮助gitPython和ssh键GitPython and SSH Keys?

我想动态地使用最新的标记版本,但又不克隆仓库。.

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知识很少

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)