This repository demonstrates how to use GitHub template repositories to automate the deployment of common scripts across multiple projects. It provides a practical example to ensure consistent inclusion of a synchronization script in new repositories.
Features
- Automates inclusion of shared scripts in new repositories using GitHub templates
- Utilizes GitHub CLI commands to manage and create template repositories
- Standardizes repository setup and project scaffolding
Tech Stack
- GitHub Repositories
- GitHub CLI (
gh) - Shell scripting (assumed for
gh_submodule_sync.sh)
Getting Started
Prerequisites
- Install GitHub CLI
- Have an existing repository containing the scripts you want to share (e.g.,
gh_submodule_sync)
Setup
-
Clone the existing repository intended as a template:
git clone https://github.com/justin-napolitano/gh_submodule_sync.git cd gh_submodule_sync -
Mark the repository as a template using GitHub CLI:
gh api -X PATCH /repos/justin-napolitano/gh_submodule_sync -f is_template=true -
Create a new repository from the template:
gh repo create new-repo --template=justin-napolitano/gh_submodule_sync --public --confirm -
Clone the newly created repository:
git clone https://github.com/justin-napolitano/new-repo.git cd new-repo
Project Structure
index.md: Documentation explaining the process and rationale for using GitHub template repositories to automate script deployment.README.md: This file, providing an overview and instructions.
Future Work / Roadmap
- Develop automation scripts to propagate template updates to existing repositories
- Provide examples for integrating additional shared scripts or configurations
- Include CI/CD pipeline templates to further standardize project setup
- Expand documentation with troubleshooting guides and advanced usage scenarios