【发布时间】:2021-04-14 01:07:30
【问题描述】:
我正在使用 GitPython 对 repos 运行几个简单的命令。基本上大部分只是:
repo = Repo(repo_dir)
repo.git.fetch()
result = repo.git.diff("origin", name_only=True)
repo.git.merge()
# ...
有没有办法设置 GitPython 来输出/记录正在运行的命令,并显示它们产生的原始输出?
例如,我希望上面的内容类似于:
$ git fetch
$ git diff --name-only origin
path/to/differing_file
path/to/another/differing_file
$ git merge
【问题讨论】: