Did you know that you can create a new repository from an already existing repository on GitHub? This allows you to inherit both the history and contents of the repository. But what if you want the contents?
GitHub allows you to create template repositories, repositories whose histories are not inherited but whose content is when creating a new repository. This simple feature is compelling for bootstrapping new projects together. It allows you to define a generic repository with all your config files ready to go rather than copying and committing them after instantiation. Furthermore, depending on how you architect your templates, you can have templates that inherit other templates.
I've found this particularly useful when creating per language templates. I have my generic repository which contains my GitHub-specific files, generic tooling config files, and other supporting documents. Then for each programming language template, each inherits the generic template. Finally, for each project, it inherits the programming language tooling most relevant to it.
I have found this to be an extreme time saver in my day-to-day work and personal projects. For an example template repository, you can see my generic template and my Python template repositories.
Top comments (0)