Doing some very simple scripting in python. I'm cloning the repository to the server with the following statement in a python script:
Repo.clone_from("source", "target")
How can I get the progress from the clone_from and pipe it to stdout?
您可以将git.remote.RemoteProgress
第三个参数用作clone_from(url, to_path, progress=None, env=None, **kwargs)
您正在使用的类方法:
class Progress(RemoteProgress):
def line_dropped(self, line):
print line
def update(self, *args):
print self._cur_line