Skip to content

DoodleScheduling/gh-bootstrap-repository

Repository files navigation

Bootstrap github repository

release release report Coverage Status license

Github does not provide an easy way to create a repository with predefined settings from another repository. A template repository for instance is only useful to copy the contents. No repository settings are copied.

This gh cli extension creates a new repository based on another one (A normal or template one).

It copies the following:

  • The content with a single commit
  • Basic repository settings
  • Branch protections
  • Organization teams (collaborators)
  • Topics

Install

gh extension install DoodleScheduling/gh-bootstrap-repository

Usage

The following command will attempt to create a repository called myorg/my-repository with all the settings and content taken from myorg/from-repository.

gh bootstrap-repository myorg/my-repository myorg/from-repository

Command line help:

expects [repository-name] [origin-repository] as arguments

Usage:
  gh-bootstrap-repository [repository-name] [origin-repository] [flags]

Flags:
  -h, --help   help for gh-bootstrap-repository

Required Permissions

It is required to be in the list of repository admins in the origin repository. The repository creation will fail otherwise.