0

いくつかのリモート リポジトリのクローンを作成したいのですが、メイン ブランチのみを取得します。

私のコードは現在、すべてのブランチを取得しています。

def init_remote(repo, name, url):
    # Create the remote with a mirroring url
    remote = repo.remotes.create(name, url, "+refs/*:refs/*")
    # And set the configuration option to true for the push command
    mirror_var = "remote.{}.mirror".format(name)
    repo.config[mirror_var] = True
    # Return the remote, which pygit2 will use to perform the clone
    return remote

pygit2.clone_repository(url, "../../clones/"+location, remote=init_remote)
4

1 に答える 1