注意1:这里是在python3环境下使用的git,安装要使用 pip install Gitpython 来安装在python环境下的git
注意2:这个方法可适用于 windows 环境和 Linux 环境
import git import tqdm repo_url = 'https://gitee.com/alichinese/oebuild-bin.git' local_path = 'F:\\test\\oebuild-bin' class GitCloneProgress(git.remote.RemoteProgress): def update(self, op_code, cur_count, max_count=None, message=''): if max_count is not None: progress_bar.total = max_count progress_bar.update(cur_count - progress_bar.n) progress_bar = tqdm.tqdm(total=100, unit='B', unit_scale=True) repo = git.Repo.clone_from(repo_url, local_path, progress=GitCloneProgress()) progress_bar.close()View Code
标签:tqdm,count,git,bar,进度条,python,progress From: https://www.cnblogs.com/salty-pineapple/p/18239073