到目前爲止,我的代碼正在執行以下操作。我想擺脫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'])