到目前为止,我的代码正在执行以下操作。我想摆脱subprocess.call()的东西使用GitPython,我该如何做git子模块更新--init
import git
from subprocess import call
repo = git.Repo(repo_path)
repo.remotes.origin.fetch(prune=True)
repo.head.reset(commit='origin/master', index=True, working_tree=True)
# I don't know how to do this using GitPython yet.
os.chdir(repo_path)
call(['git', 'submodule', 'update', '--init'])