【发布时间】:2020-10-27 11:39:05
【问题描述】:
如何查看克隆过程的进度? tqdm 模块不适用于单行语句。我应该添加一个 git 参数吗?任何参考都会有所帮助。谢谢。
import git
#clone to local system
git.Repo.clone_from(repo_url,path, branch='master')
【问题讨论】:
标签: python git progress-bar tqdm
如何查看克隆过程的进度? tqdm 模块不适用于单行语句。我应该添加一个 git 参数吗?任何参考都会有所帮助。谢谢。
import git
#clone to local system
git.Repo.clone_from(repo_url,path, branch='master')
【问题讨论】:
标签: python git progress-bar tqdm
def clone_from(cls, url, to_path, progress=None, env=None, multi_options=None, **kwargs):
在git.remote.Remote.push 中定义了进度
:param progress:
Can take one of many value types:
* None to discard progress information
* A function (callable) that is called with the progress information.
Signature: ``progress(op_code, cur_count, max_count=None, message='')``.
* An instance of a class derived from ``git.RemoteProgress`` that
overrides the ``update()`` function.
您可以查看progress function here 或here 的示例。
【讨论】: