1

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?

4

1 回答 1

3

您可以将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
于 2015-07-24T08:22:11.827 回答