Skip to content

Consider use_repo_template function? #109

@cboettig

Description

@cboettig

usethis has great utilities for setting up a vanilla template using create_package(), along with use_git(), use_github() , as @jennybc describes in https://community.rstudio.com/t/procedure-to-create-a-project-for-a-package-destined-for-github/2054/4.

But this twitter thread got me thinking: often rather start with my own template: don't have to enter my name, choose my usual license, and other tweaks. Moreover, sometimes my template isn't a package, but a more minimal project repo; or maybe it's a specific template for some classroom assignment I want students to use.

It would be nice to have a function to deploy some existing template repo. e.g. this is basically what GitHub forking does, without creating the 'fork' connection, and allowing a new repo name. (Similar also to what GitHub Classroom does, but that's bound to a single organization destination).

I think this would be a straight-forward wrapper around existing git2r / command-line git calls to rename the remote origin; possibly with a gh wrapper (or just single github API call via httr to avoid the dependency?) to create the new repo on GitHub. I sketched a prototype of this here: https://github.com/cboettig/template/blob/master/R/template.R. Would be happy to send a PR if something along these lines makes sense, though no doubt the usethis team could manage a more robust implementation more efficiently anyhow, if it's worth doing.

Thanks for your thoughts.

Metadata

Metadata

Assignees

No one assigned

    Labels

    featurea feature request or enhancement

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions