pull_from_remote.py 文件源码

python
阅读 21 收藏 0 点赞 0 评论 0

项目:nbpuller 作者: data-8 项目源码 文件源码
def _initialize_repo(repo_url, repo_dir, branch_name, config, progress=None):
    """
    Clones repository and configures it to use sparse checkout.
    Extraneous folders will get removed later using git read-tree
    """
    util.logger.info('Repo {} doesn\'t exist. Cloning...'.format(repo_url))
    # Clone repo
    repo = git.Repo.clone_from(
        repo_url,
        repo_dir,
        progress,
        branch=branch_name,
    )

    # Use sparse checkout
    config = repo.config_writer()
    config.set_value('core', 'sparsecheckout', True)
    config.release()

    util.logger.info('Repo {} initialized'.format(repo_url))
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号